Article View: borland.public.cppbuilder.database.ado
Article #3019Re: connection->Connected == true ??
From: Max Luzin
Date: Thu, 30 Jan 2003 18:19
Date: Thu, 30 Jan 2003 18:19
25 lines
2096 bytes
2096 bytes
Hm-m-m... ;-) In Client/Server architecture (almost for all DB servers) it's by default no activities from server side. In most cases only client initialize all actions, therefore you should just "ping" your DB server to check "the reality" of connection. Just create SELECT query for ANY table (it may be dummy table at all) with MaxRecords parameter equal to "1" (and CacheSize=1). DB access layer should generate an error if the connection to DB lost. Catch the error in your code and process it. It is simplest and reliable way. Max "newbie" <ms_Crack@yahoo.com> wrote in message news:3e2eea88$1@newsgroups.borland.com... > > Hello all, > > I always evaluate if my ADO->connection is == true before performing a query, however this does not always guarantee that a connection is in fact enabled. If I disconnect a network cable after connecting to a database, the connection->connected still is equal to true. Is there any other means of determining if a connection is truly connected, short of error handling on a failed query attempt? >
Technical Details
Message-ID:
<3e396c25@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3e2eea88$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,95c710cdf49de714 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-01-30 10:40:16 PST Reply-To: "Max Luzin" <maksim.luzin@wsy.lt> From: "Max Luzin" <maksim.luzin@wsy.lt> Newsgroups: borland.public.cppbuilder.database.ado References: <3e2eea88$1@newsgroups.borland.com> Subject: Re: connection->Connected == true ?? Date: Thu, 30 Jan 2003 20:19:32 +0200 Lines: 27 Organization: Western Shipyard X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.59.13.100 Message-ID: <3e396c25@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1043950629 212.59.13.100 (30 Jan 2003 10:17:09 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail