procedure TForm1.Button1Click(Sender: TObject);
begin
with ADOQuery1 do
begin
try
ADOConnection1.BeginTrans;
Close;
SQL.Text:='delete ss_HJjchz where shz_pch=''1201201510150003'' ';
ExecSQL;
SQL.Text:='delete @#$%^&*()';//无法执行的SQL语句
ExecSQL;
ADOConnection1.CommitTrans; //提交
Application.MessageBox('提交成功','');
except
ADOConnection1.RollbackTrans; //回滚(撤销)
Application.MessageBox('提交失败','');
end;
end;
end;
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交