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 2009 查看所有 unicode 字符

Delphi 如何从url提取文件名?

Delphi保存读取utf-8的文本文件

Delphi application.processmessages

Delphi tms web core tedit编辑输入框属性展示

Delphi xe5 android程序常用的unit

Delphi 删除internet临时文件

Delphi xe10对json的解析应用

Delphi idhttp post json 上传 php 接收

Delphi纯api窗体程序

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



打赏

取消

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

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

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

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

评论

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

    暂无评论...