Parameters Collection
Open Method
Record Close Method
Recordset Close Method
Stream Close Method
METHOD Connection::Close
connectionobject.
Close
The
Close
method is used to close a
Connection
object and certain associated objects. Closing an
Connection
object does not delete it from memory. You can later use the
Open
method to reopen the same
Connection
.
If there are open
RecordSet
objects associated with the
Connection
object being closed, then all of the
RecordSet
objects are automatically closed. There is also a rollback of all pending changes in the open
RecordSet
objects. Calling
Close
while a transaction is in progress will generate an error.
If there is an open
Command
object associated with the
Connection
object being closed, the
Command
object remains open, but its
ActiveConnection
property is set to
Nothing
and it loses all association with the closed
Connection
.
If you have closed an object and you no longer need it, you can set it equal to
Nothing
which will remove it from memory.
Code (VBScript):
If objConnection.State = adStateOpen Then
objConnection.
Close
End If
Set objConnection = Nothing
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information