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 如何快速读写文件中的字符串

Delphi获取pid的父进程文件名

Delphi 释放res资源文件

Delphi颜色转换函数

Delphi 在unicodestring中使用utf-8字符串

pascal 语言中的关键字及保留字

Delphi 如何把程序钉到windows7任务栏(修正版)

Delphi clientdataset复制记录

Delphi点击网页弹出的alert对话框的确定按钮

Delphi 数字转excel字母列序号

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



打赏

取消

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

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

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

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

评论

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