用ADO的话用:ADOConnection.BeginTranshe和ADOConnection.CommitTrans及
ADOConnection.RollbackTrans
用BDE的话用:
  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;