Delphi ADO的事务处理例子


本文整理自网络,侵删。

 
ADO的事务处理例子(Delphi)
ADOConnection1.BeginTrans;   //开始事务
try
with ADOCommand1 do
begin
Connection:=ADOConnection1;
commandtext:='update [country] set [population]=10000 where [name=''Venezuela''';//正确的SQL语句
Execute;
CommandText:='Wrong SQL Command';//错误的SQL Execute;
ADOConnection1.CommitTrans; //提交事务end;
except on E:
Exception do
begin
ADOConnection1.RollbackTrans; //如有异常,事务回滚ShowMessage(E.Message); end end;
end;
――――――――――――――――

原文链接:https://blog.csdn.net/zzflover/article/details/2481093

相关阅读 >>

Delphi xe5 android 调用 google zxing

Delphi 生成随机字符串

Delphi压缩图片代码

Delphi filestream

Delphi 判断文件是否存在

Delphi 获取网站验证码的图片

Delphi操作word中的表

Delphi读取android短信信息

Delphi format函数的用法

Delphi程序带参数运行

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...