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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO connection object

Status
Not open for further replies.

zfang

Programmer
Apr 3, 2002
23
US
Hi There:

How to check whether an ADO connection object calls the open method successfully? Say,

set conn = Server.CreateObject("ADODB.Connection")
coon.open = "a connection string"

Is there a way to check the db connection works?

Thanks,

George

 
The state of the connection object will tell you.

After conn.open = "a connection string", check like this

if conn.state = 1 then
(you have a valid open connection)
else
error message
end if

Regards,

Patrick
 
Patrick:

Thanks a lot. It works great.

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top