delete之后记录指针没有移动,指向一个无效的记录位置。

解决方案 »

  1.   

    但用movenext()为什么还是指向无效纪录?
      

  2.   

    没到EOF!第一次使用delete();movenext()好使,再删一次就有问题,关闭重新运行后还是第一次好使:-(
      

  3.   

    使用delete后,指针指向一个无效的随机的位置,通常用movenext应该没问题,但movenext之后也不会是下一条记录,所以应该requery,if(!Eof)delete。
      

  4.   

    After a successful deletion, the recordset’s field data members are set to a Null value, and you must explicitly call one of the recordset navigation member functions (Move, Seek, SetBook, and so on) in order to move off the deleted record. When you delete records from a recordset, there must be a current record in the recordset before you call Delete; otherwise, MFC throws an exception.removes the current record and makes it inaccessible. Although you cannot edit or use the deleted record, it remains current. Once you move to another record, however, you cannot make the deleted record current again. Any Delete call, even if it removes the only remaining record from a recordset, will not change the value of IsBOF or IsEOF. see also
    CDaoRecordset::IsDeleted
    BOOL IsDeleted( ) const;