How to detect an empty CRecordset object in Visual C++
Article ID: 121950
Article Last Modified on 11/21/2006
APPLIES TO
- Microsoft Foundation Class Library 4.2, when used with:
- Microsoft Visual C++ 1.5 Professional Edition
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 4.2 Enterprise Edition
- Microsoft Visual C++ 5.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 4.0 Professional Edition
- Microsoft Visual C++ 4.1 Subscription
- Microsoft Visual C++ 4.2 Professional Edition
- Microsoft Visual C++ 5.0 Professional Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 5.0 Learning Edition
- Microsoft Visual C++ 5.0 Learning Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft Visual C++ .NET 2002 Standard Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
- Microsoft Visual C++ 2005 Express Edition
This article was previously published under Q121950
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.
SUMMARY
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.
REFERENCES
This behavior is described in the documentation for
CRecordset::IsEOF and CRecordset::IsBOF.
Additional query words: empty recordset MfcDatabase kbprg
Keywords: kbhowto kbdatabase KB121950