Nov 18, 2003 #1 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
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
Nov 19, 2003 #2 PatrickIRL Programmer Jun 25, 2003 383 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 Upvote 0 Downvote
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
Nov 19, 2003 Thread starter #3 zfang Programmer Apr 3, 2002 23 US Patrick: Thanks a lot. It works great. George Upvote 0 Downvote