CRecordset::GetRecordCount
long GetRecordCount( ) const;Return ValueThe number of records in the recordset; 0 if the recordset contains no records; or –1 if the record count cannot be determined.ResCall this member function to determine the size of the recordset. Caution   The record count is maintained as a “high water ” — the highest-numbered record yet seen as the user moves through the records. The total number of records is only known after the user has moved beyond the last record. For performance reasons, the count is not updated when you call MoveLast. To count the records yourself, call MoveNext repeatedly until IsEOF returns nonzero. Adding a record via CRecordset:AddNew and Update increases the count; deleting a record via CRecordset::Delete decreases the count.