Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
use active cell to determine range | Excel Discussion (Misc queries) | |||
How to Determine if Application Window Still Active | Excel Discussion (Misc queries) | |||
Data Connection - Active Directory | Excel Discussion (Misc queries) | |||
Can I determine the active selection's type? | Excel Programming | |||
Determine active file size | Excel Programming |