看看示列: if not ADOQuery1.Connection.InTransaction then ADOQuery1.Connection.BeginTrans try ....... ; .......; ADOQuery1.Connection.CommitTrans; except begin On E:exception do begin showmessage('Êý¾Ý¸üÐÂʧ°Ü,´íÎóÔ­Òò:'+E.message); ADOQuery1.Connection.RollbackTrans; end; end; end;
或者手动设置,写语句才能提交!
if not ADOQuery1.Connection.InTransaction then
ADOQuery1.Connection.BeginTrans
try
....... ;
.......;
ADOQuery1.Connection.CommitTrans;
except
begin
On E:exception do
begin
showmessage('Êý¾Ý¸üÐÂʧ°Ü,´íÎóÔ­Òò:'+E.message);
ADOQuery1.Connection.RollbackTrans;
end;
end;
end;