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