我正在设计的数据库要求将表A中的数据插入到B表中,然后删除A表中数据
我想用事务。
请提供方法
AdoConnection.BeginTrans;
Try
插入操作..
删除操作..
AdoConnection.CommitTrans;
Except
AdoConnection.RollBackTrans;
End;
try
adoconnection.beginstran;
do...
adoquery1.append;
aodquery1.fieldbyname(field).asstring:=edit1.text;
....
adoquery1.post;
adoconnection.commition;
except
adoconnection.rollback;
showmessage(删除错误or 插入错误);
end;