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. 这一段是MSDN的描述,如果你觉得不放心,可以用循环;循环觉得开销太大,直接select count(*)算了 至于有没有别的更好的办法,让我找一下
要得到真正的记录数,必须在调用CRecordset::GetRecordCount()前调用MoveLast。
MSDN好像不推荐使用这个方法来获得Recordset的size,其实自己写一个循环最安全
至于有没有别的更好的办法,让我找一下
刚才看了一下,直接movelast也不行,必须一条条的movenext才行,哈哈,要求老板升级机器吧!