CurrentProject.CloseConnection method (Access)

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.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.