Home Forums C Programming MFC:GetRecordCount() Reply To: MFC:GetRecordCount()

#3182
sameena
Participant

Hi Yes I thought it would be a great function like Clippers various functions but it does not work.

From http://www.codeproject.com/ Caution The record count is maintained as a “high water mark” 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.”You open the databae set a filter and cannot query the database using GetRecordCount(). You have to move beyond the last record for some reason.

Thanks for your help
MegaC

  • This reply was modified 8 years, 10 months ago by M. Saqib.
  • This reply was modified 1 year, 2 months ago by M. Saqib.