Freigeben über


CRecordset::Close

Closes the recordset.

virtual void Close( );

Remarks

The ODBC HSTMT and all memory the framework allocated for the recordset are deallocated. Usually after calling Close, you delete the C++ recordset object if it was allocated with new.

You can call Open again after calling Close. This lets you reuse the recordset object. The alternative is to call Requery.

Example

// Construct a snapshot object
CCustomer rsCustSet(NULL);

if(!rsCustSet.Open())
   return;

// Use the snapshot ...

// Close the snapshot
rsCustSet.Close();

// Destructor is called when the function exits

Requirements

Header: afxdb.h

See Also

Concepts

CRecordset Class

CRecordset Members

Hierarchy Chart

CRecordset::CRecordset

CRecordset::Open

CRecordset::Requery