一般来说,数据引擎如:bde可以自已管理事务的,当成功处理数据后,事务就会自动提交,出错就会回滚。当然你也可以用
Database1.StartTransaction ;
Database1.Commit;
Database1.Rollback;
来控制:如:
procedure TForm1.ApplyButtonClick(Sender: TObject);begin
  with CustomerQuery do
  begin
  Database1.StartTransaction;
    try
      ApplyUpdates; {try to write the updates to the database};
      Database1.Commit; {on success, commit the changes};
    except
      Database1.Rollback; {on failure, undo the changes};
    raise; {raise the exception to prevent a call to CommitUpdates!}
    end;
  CommitUpdates; {on success, clear the cache}
  end;end;