Close

This method closes an open object and any dependent objects.

Syntax

recordset.Close

Remarks

Use the Close method to close a Recordset object and free any associated system resources. However, closing an object does not remove it from memory; you can change its property settings and open it again later. To eliminate an object from memory, set the Recordset object variable to Nothing.

Closing a Recordset object releases the associated data you may have obtained through the Recordset object but does not affect the underlying database. You can call the Open method later to reopen the recordset with the same or modified attributes. You must close a recordset before changing the structure of the underlying database.

While the Recordset object is closed, calling any methods that require a current row generates an error. Trying to close a closed recordset also generates an error.

If an edit is in progress, calling the Close method generates an error; to avoid this error, call the Update or CancelUpdate method first.

If you use the Clone method to create copies of an open Recordset object, closing the original or a clone does not affect any of the other copies.