Closing a CDaoRecordset object removes it from the collection of open recordsets in the associated database.

virtual void Close( );


Because Close does not destroy the CDaoRecordset object, you can reuse the object by calling Open on the same data source or a different data source.

All pending AddNew or Edit statements are canceled, and all pending transactions are rolled back. If you want to preserve pending additions or edits, call Update before you call Close for each recordset.

You can call Open again after calling Close. This lets you reuse the recordset object. A better alternative is to call Requery, if possible.

For related information, see the topic "Close Method" in DAO Help.


Header: afxdao.h

See Also


CDaoRecordset Class

Hierarchy Chart