怎样控制人为更新,如加两个BUTTON,按确定后更新,按取消后返回。

解决方案 »

  1.   

    procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
    begin
      if key = #$0D then
        showmessage('更新')
      else if key = #$1B then
        showmessage('取消')
    end;
      

  2.   

    btncancel click()
    begin
      qrycancel.cancel;//取消更新
    end;
      

  3.   

    qrydata.ApplyUpdate;//更新(BUTTON1)
    qrydata.Cancel;    //;//取消更新(BUTTON2)
      

  4.   

    qrydata是什么控件?DataSource还是ADOTable?