 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Eddy Fontaine Guest
|
Posted: Thu Jan 27, 2005 12:43 pm Post subject: Can you efficiently check an ODBC connection before using it |
|
|
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
|
Posted: Thu Jan 27, 2005 1:51 pm Post subject: Re: Can you efficiently check an ODBC connection before usin |
|
|
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 |
|
 |
|
|
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
|
|