Article View: borland.public.cppbuilder.database.ado
Article #865Simple ADOQuery read problem on one machine...
From: Vladimir Stefanovic
Date: Sun, 03 Jul 2005 21:33
Date: Sun, 03 Jul 2005 21:33
55 lines
2070 bytes
2070 bytes
Hi,
This is the routine I use to check the DB version which I store
in a Table with only one record and only one filed.
This routine *is working* on maybe 500 machines, but I got
one report from which I concluded that this is the piece of
code that failed ( returned "").
The problematic OS was WinXP Home SP2.
Do you see what can go wrong in this routine to fail?
Can damaged MDAC can be the problem?
Can some system security settings be the reason?
AnsiString TDiMainForm::GetDBVer()
{
AnsiString Ver = "";
ADOQuery->Close();
ADOQuery->SQL->Clear();
ADOQuery->SQL->Add( "select top 1 * from TblVer" );
AnsiString CS = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
ChangeFileExt( ParamStr(0), ".mdb" ) +
";Mode=Read;Persist Security Info=False";
ADOQuery->ConnectionString = CS;
try
{
try
{
ADOQuery->Open();
Ver = ADOQuery->FieldValues["Ver"];
}
catch ( const Exception &e )
{
// ...
}
}
__finally
{
ADOQuery->Close();
}
return ( Ver );
}
--
Best regards,
Vladimir Stefanovic
Technical Details
Message-ID:
<42c85997@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,50bff259ed7b75bb,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.database.ado Subject: Simple ADOQuery read problem on one machine... Date: Sun, 3 Jul 2005 23:33:12 +0200 Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 82.117.212.65 Message-ID: <42c85997@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1120426391 82.117.212.65 (3 Jul 2005 14:33:11 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail