CloseConnection Method

CloseConnection Method

See Also                  Applies To

You can use the CloseConnection method to close the current connection between the CurrentProject or CodeProject object in a Microsoft Access project (.adp) or Access database (.mdb) and the database specified in the project's base connection string.

Syntax

object.CloseConnection

The CloseConnection method has the following argument.

Argument Description
object A string expression that evaluates to the CurrentProject or CodeProject object.

Remarks

The CloseConnection method closes the current connection of the Access project, database, or data source control, frees the ADO Connection object, and sets the Connection property to Null. The BaseConnectionString property is left unchanged. Users are prevented from calling datasoucecontrol.Connection.Close and must use this method instead.

The CloseConnection method is useful when you have opened a Microsoft Access database from another application through Automation.