ADODB Object
 
Syntax
 
recordsetobject.Close
 
Description
The Close method is used to close a Recordset object. As a consequence, you also lose access to any associated data.
 
Closing a Recordset object does not delete it from memory. You can later use the Open method to reopen the same Recordset, with or without the same properties. If you have closed an object and you no longer need it, you can set it equal to Nothing which will remove it from memory.
 
Calling the Close method while an edit is in process will generate an error. You should first call the Update or CancelUpdate methods. If a Recordset is in batch update mode, you may need to call UpdateBatch before calling Close, or you will lose any pending updates.
See Also
Connection.Close, Record.Close, Open, Stream.Close.
Example
 
If objRecordset.State = adStateOpen Then
   objRecordset.Close
End If
Set objRecordset = Nothing