How to determine if a connection is active
I am writing an addin that manages an ODBC/OLEDB connection to a
database. I manage to make the connection without trouble. However, I would like to be able to determine if the connection is still active; for instance, the database might drop the connection if a certain amount of time has passed without activity. How can I determine if a connection is active? Many thanks, Phil |
How to determine if a connection is active
check the .State property of the adodb.Connection object anyway.. you should not needlessly leave the connection open. close it when done. reopen when need. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam wrote : I am writing an addin that manages an ODBC/OLEDB connection to a database. I manage to make the connection without trouble. However, I would like to be able to determine if the connection is still active; for instance, the database might drop the connection if a certain amount of time has passed without activity. How can I determine if a connection is active? Many thanks, Phil |
How to determine if a connection is active
That works fine. I'm testing for .State = 1 to determine if a
connection is active. Would you happen to know the values that .State can take on? I'm sorry to ask, but the ADODB help library isn't installed on any of the machines I have access to. And I agree with you that I shouldn't needlessly leave the connection open. But I have rather a strange situation where it makes some sort of sense to let the user manage the connection rather than trying to do it in my program, and I prefer to test if the connection exists rather than trap the error that occurs if it doesn't exist. Thanks for the help. Phil |
How to determine if a connection is active
Excellent reference. Thank you. I should have searched harder after
finding the appropriate help file wasn't loaded. Thanks, Phil |
All times are GMT +1. The time now is 06:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com