Name
Connection.Close Method — (Versions 2.0, 2.1, 2.5, 2.6)
Synopsis
connection.CloseThe Close method is used to close either a Connection or Recordset object, including any dependent objects that they may have.
Description
The Close method terminates a connection with a data source. After a Connection object is closed, properties can be adjusted, and the object can be opened again. Calling methods that require a connection while the Connection object is closed generates an error.
Closing a Connection object that one or more Recordset objects were created from causes those Recordset objects to close as well. All pending changes are lost. If there is a pending transaction, an error occurs.
Closing a Connection object does not remove it from memory, it only
frees the resources that it is using. To remove the Connection object
from memory in Visual Basic, set it to Nothing.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access