BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can you efficiently check an ODBC connection before using it

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Eddy Fontaine
Guest





PostPosted: Thu Jan 27, 2005 12:43 pm    Post subject: Can you efficiently check an ODBC connection before using it Reply with quote



Hi there !

It seems to me that the ADOConnection can tell you 'connected' even
if the network connection to the database is defective...
How can one be sure to be 'connected' ?

Or should i disconnect after transactions and reconnect when i need it ?

Thanks,
Eddy.



Back to top
Jeremy Collins
Guest





PostPosted: Thu Jan 27, 2005 1:51 pm    Post subject: Re: Can you efficiently check an ODBC connection before usin Reply with quote



Eddy Fontaine wrote:
Quote:
Hi there !

It seems to me that the ADOConnection can tell you 'connected' even
if the network connection to the database is defective...
How can one be sure to be 'connected' ?

You have to put in some exception handling; you are correct
to say that the connection still says "Connected = True" when
you pull out the network cable.

Quote:
Or should i disconnect after transactions and reconnect when i need it ?

Depends on the needs of your application, how slow it is to
connect, if you're doing lots of things with the connection
etc. I once read an early ADO article on MSDN that recommended
connecting only when you need to, but IME that's a bit too
simplistic.


--
jc

Remove the -not from email

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.