CloseConnection Method

Microsoft Access Visual Basic

or CodeProject object in a Microsoft Access project (.adp) or Access database (.mdb) and the database specified in the project's base connection string.

expression.CloseConnection

expression    Required. An expression that returns one of the objects in the Applies To list.

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.