Share via


CurrentProject.CloseConnection Method (Access)

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

Syntax

expression .CloseConnection

expression A variable that represents a CurrentProject object.

Return Value

Nothing

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 datasourcecontrol.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.

See Also

Concepts

CurrentProject Object Members

CurrentProject Object