以前没注意过会有这样的情况,
DBEdit连的ADOtable,正在做保存按钮呢,一测试发现输入到edit中的数据自动会存到数据库中,强!
请问如何屏蔽这种情况,我想用按钮实现。谢谢。

解决方案 »

  1.   

    if adotable.State in [DsInsert,DsEdit] then     或用 if  adotable.modified then
                begin
                    Adotable.cancel;
                end;
      

  2.   

    设ADOTable的LockType为ltBatchOptimistic进行批量更新试一下,在其UpdateBatch前还可以撤销
      

  3.   

    请问chinaandys(降龙十八炒,这个过程应该写在哪个事件中?
      

  4.   

    干脆用edit,我以前也用DBEdit,发现不好用显示数据倒还可以,若要有别的操作,就麻烦了用edit时,用fieldbyname关联即可