Udostępnij za pośrednictwem


CRecordset::GetStatus

Determines the index of the current record in the recordset and whether the last record has been seen.

void GetStatus( 
   CRecordsetStatus& rStatus  
) const;

Parameters

  • rStatus
    A reference to a CRecordsetStatus object. See the Remarks section for more information.

Remarks

CRecordset attempts to track the index, but under some circumstances this may not be possible. See GetRecordCount for an explanation.

The CRecordsetStatus structure has the following form:

struct CRecordsetStatus

{

long m_lCurrentRecord;

BOOL m_bRecordCountFinal;

};

The two members of CRecordsetStatus have the following meanings:

  • m_lCurrentRecord   Contains the zero-based index of the current record in the recordset, if known. If the index cannot be determined, this member contains AFX_CURRENT_RECORD_UNDEFINED (–2). If IsBOF is TRUE (empty recordset or attempt to scroll before first record), then m_lCurrentRecord is set to AFX_CURRENT_RECORD_BOF (–1). If on the first record, then it is set to 0, second record 1, and so on.

  • m_bRecordCountFinal   Nonzero if the total number of records in the recordset has been determined. Generally this must be accomplished by starting at the beginning of the recordset and calling MoveNext until IsEOF returns nonzero. If this member is zero, the record count as returned by GetRecordCount, if not –1, is only a "high water mark" count of the records.

Requirements

Header: afxdb.h

See Also

Reference

CRecordset Class

Hierarchy Chart

CRecordset::GetRecordCount

Other Resources

CRecordset Members