access数据库 + adoquery (采用批量更新方式(LockType 为 ItBatchOptimistic))如果 delete 了某几条记录,未 UpdateBatch 之前,还能否访问这几条记录?

解决方案 »

  1.   

    应该可以,我没试过,好像Filter有选项可筛选出删除的记录。
      

  2.   

    未 UpdateBatch 就是为提交给数据库
    只放在缓存里,能不能访问不清楚
      

  3.   

    adoquery.cancel
    取消以后就可以访问了吧
      

  4.   


    关键问题是我试了没有达到我的要求,才来问你们。用户要删除,更改一些数据,程序等用户操作完成之后再一起处理。比如他删除了一些记录,程序要同时更新其他表的一些字段(不能在他删除记录时就处理其他表的记录,因为希望能提供用户取消操作的功能,所以只能等用户确认操作全部结束且正确后再处理,有点象批处理)。adoquery 的 RecordStatus 属性,有如下属性:rsNew       The row is a new insert.
    rsModified     The row has been modified.
    rsDeleted       The row has been deleted.
    rsUnmodified   The row has not been modified since being retrieved.其他都能正确判断,但 rsDeleted 根本无法得到!!
    请大家帮忙。谢谢
      

  5.   

    http://community.csdn.net/Expert/topic/2725/2725902.xml?temp=.8590052大家可以参考这个帖子,但我看了他们的回答不符合我的要求。我的数据库是access
      

  6.   


    我对adoq(批量更新方式打开)的记录集进行了一些操作,然后调用下面的函数,被删除的记录根本无法访问的。现在问题就是我要知道怎么访问!!!!!!!!!在线等
    var
      tpUM, tpM, tpD, tpN: String;
    begin
      with Adoq do
      begin
        First;
        while not eof do
        begin
          if (rsUnmodified in RecordStatus) then tpUM := tpUM + Inttostr(RecNo) + '-';//'Unchanged record';
          if (rsModified in RecordStatus) then tpM := tpM + Inttostr(RecNo) + '-';// 'Changed record';
          if (rsDeleted in RecordStatus) then tpD := tpD + Inttostr(RecNo) + '-';// 'Deleted record';
          if (rsNew in RecordStatus) then tpN := tpN + Inttostr(RecNo) + '-';//  'New record';
          Next;
        end;
      end;  showmessage('UM: ' +tpUM);
      showmessage('M: '  +tpM);
      showmessage('Del: '+tpD);
      showmessage('New: '+tpN);
    end;