Knowledge Base

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

Article ID: 121950

Article Last Modified on 11/21/2006


APPLIES TO


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