The State property allows you to determine whether a connection is open, closed, connecting, or executing a command. The value will be a bit mask containing one or more of the following ObjectStateEnum constants:
□ adStateClosed — The connection is closed
□ adStateOpen — The connection is open
□ adStateConnecting — The object is in the process of making a connection
□ adStateExecuting — The connection is executing a command
If you attempt to close a Connection object that is already closed, you will cause an error. You can prevent this from occurring by testing the state of the Connection object before closing it:
If CBool(objConn.State And adStateOpen) Then objConn.Close
Was this article helpful?
Get Inspired By The Most Popular Bloggers Online! If You Want To Skyrocket Your Success With Business And Improve Your Overall Life You Need To Have A Look At The Accidental Blogging Millionaires! Business can be a fight, particularly when you’re trying to establish one online and like all fights, to succeed you must find the winning techniques and apply them.