Reply To: MFC:GetRecordCount()

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

#3182

sameena
Member

HiYes I thought it would be a great function like Clippers various functions but it does not work. From http://www.codeproject.com/scrapbookcrecordsetnonos.asp” 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 helpMegaC