0

if db.open = true then
db.close
End if

I want some code like this where it will check in the form load and if the connection is open , and if it is open it will close it..

3
Contributors
4
Replies
16
Views
9 Years
Discussion Span
Last Post by swappy
0

You pretty much have it spot on in your first post swappy...
I use this code to check the connection state:

If oConnection.State = adStateOpen Then
        oConnection.Close
    End If

For info, oConnection was instantiated as ADODB.Connection beforehand.

Enjoy!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.