Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if ADODB connection is open? 1

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
as above???

 
If adConn.State = adStateOpen Then
' Connection is open
Else
' Connection is closed
End If

adStateOpen = 1
adStateClosed = 0
 
oops, sorry i mean how do i check if the object exists.

i get the following error message when i try and reference the object:

"Object variable of With block variable not set"


Thanks again!

 
if not adConn is nothing then
' do some stuff
else
' can't use adconn
end if

As well, you might be getting that error if you do not Set adConn = New ADODB.Connection before you try to make a connection.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top