CRecordset::Close

 

关闭记录集。

语法

virtual void Close( );

备注

为记录集分配的框架释放ODBC HSTMT 和所有内存。通常在调用 Close后,您删除C++记录集对象是否分配了 new

可以在调用 Close之后再次调用 Open。这使您可以重新使用记录集对象。另一种方法是调用 Requery

// 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

要求

Header: afxdb.h

请参阅

CRecordset Class
层次结构图
CRecordset::CRecordset
CRecordset::Open
CRecordset::Requery