在该语句前加
while(!wordtable.eof())wordtable.GetNext();

解决方案 »

  1.   

    哈哈,帮你查了一下msdn:
    好象是这样:
        你要用GetRecordCount函数得到数据库表中记录数目只能在已经访问过表中最后一条记录后
    才能获得正确的数目,那就是说要在调用GetRecordCount之前先使用MoveLast函数。当然楼上那
    位的方法也可以!
    ================================================================================
    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. 
    ================================================================================