How to detect an empty CRecordset object in Visual C++

This article was previously published under Q121950
This article has been archived. It is offered "as is" and will no longer be updated.
Note Microsoft Visual C++ .NET (2002) supports both the managed code model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows code model. The information in this article applies only to unmanaged Visual C++ code.

Note Microsoft Visual C++ .NET 2005 supports both the managed code model that is provided by the .NET Framework and the unmanaged native Windows code model.
The CRecordset represents a set of records obtained from a data source through a query. If no records from the data source match the query, there will be no records in the record set object so CRecordset::IsEOF and CRecordset::IsBOF both return a nonzero value. A query is executed during calls to CRecordset::Open and CRecordset::Requery, so empty record sets can be detected calling CRecordset::IsEOF and/or CRecordset::IsBOF after executing a query.
This behavior is described in the documentation for CRecordset::IsEOF and CRecordset::IsBOF.
empty recordset MfcDatabase kbprg

Article ID: 121950 - Last Review: 02/28/2014 07:55:35 - Revision: 4.1

  • Microsoft Foundation Class Library 4.2
  • kbnosurvey kbarchive kbhowto kbdatabase KB121950