TDataSetCancel (Delphi)
Description
The following fragment prompts you to confirm changes to a record; if you click Yes, the record is posted to the table, otherwise the changes are cancelled.
Code
procedure TForm1.Button2Click(Sender: TObject);
begin
if MessageDlg('Update Record?', mtConfirmation, [mbYes, mbNo], 0) =
mrYes then
Table1.Post
else
Table1.Cancel;
end;
Uses
- Data.DB.TDataSet.Cancel ( fr | de | ja )
- Data.DB.TDataSet.Post ( fr | de | ja )