Export (0) Print
Expand All
MFC
Expand Minimize

CRecordset::Close 

Closes the recordset.


virtual void Close( );

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 for CRecordset::Close

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

if( !rsCustSet.Open( ) )
   return FALSE;

// Use the snapshot ...

// Close the snapshot
rsCustSet.Close( );

// Destructor is called when the function exits

Community Additions

ADD
Show:
© 2014 Microsoft