Article View: borland.public.cppbuilder.database.ado
Article #866Re: Simple ADOQuery read problem on one machine...
From: Viatcheslav V. Vassiliev
Date: Mon, 04 Jul 2005 05:53
Date: Mon, 04 Jul 2005 05:53
70 lines
2752 bytes
2752 bytes
Is there any error message? Empty string will be returned if TblVer is
empty.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Vladimir Stefanovic" <antivari@po.sbb.co.yu> �������/�������� � ��������
���������: news:42c85997@newsgroups.borland.com...
> 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:
<42c8cecb$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42c85997@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,50bff259ed7b75bb X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <42c85997@newsgroups.borland.com> Subject: Re: Simple ADOQuery read problem on one machine... Date: Mon, 4 Jul 2005 09:53:13 +0400 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 85.93.138.132 Message-ID: <42c8cecb$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1120456395 85.93.138.132 (3 Jul 2005 22:53:15 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail