adoconnection1.begintrans; // 开始事务
try
adoconnection1.execute(sqlstr1);
adoconnection1.execute(sqlstr2);
...
adoconnection1.execute(sqlstrN);
adoconnection1.commitrans; // 提交事务
showmessage('操作成功');
except
adoconnection1.rollbacktrans; // 事务回滚
showmessage('操作失败');
end;
try
adoconnection1.execute(sqlstr1);
adoconnection1.execute(sqlstr2);
...
adoconnection1.execute(sqlstrN);
adoconnection1.commitrans; // 提交事务
showmessage('操作成功');
except
adoconnection1.rollbacktrans; // 事务回滚
showmessage('操作失败');
end;