View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default How to determine if a connection is active

object browser:
state

enum ObjectStateEnum

adstateclosed
adstateconnecting
adstateexecuting
adstatefetching
adstateopen

for reference:
http://msdn.microsoft.com/library/de.../en-us/ado270/
htm/mdmscadoapireference.asp

(or search msdn for adodb api reference)

i often use:
www.devguru.com Ado Quick Reference
http://www.devguru.com/Technologies/...ado_intro.html


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


wrote :

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