CDaoRecordset::Close

virtual void Close( );
throw( CDaoException );

Remarks

Closing a CDaoRecordset object removes it from the collection of open recordsets in the associated database. 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 more information about working with recordsets, see the article DAO: Creating, Opening, and Closing DAO Objects in Visual C++ Programmer's Guide. For related information, see the topic "Close Method" in DAO Help.

CDaoRecordset OverviewClass MembersHierarchy Chart

See Also   CDaoRecordset::Open, CDaoRecordset::CDaoRecordset