在edit中填的数据,按了一个按钮后,显示到dbgrid中,但不提交到数据库中,
按另一个按钮后,提交到那里面,怎么实现,

解决方案 »

  1.   

    利用事务处理,就可以了
    http://expert.csdn.net/Expert/topic/2298/2298406.xml?temp=.3486139
      

  2.   

    把ADOQuery1的属性:locktype:=itbactchoptimistic,usorlocation:=cluserclient
    cursortype:=keyset
    sql: select * from 表名 where 1=0保存时:(显式提交)
    with adoconnection1 do
    begin
      begintrans;  //事务开始
      try
       adoquery1.updatebatch;  //批量保存
       committrans;     //提交事务
      except
       rollbacktrans;必  //失败回滚
       rasise;
       exit;
     end;
    end;