There is a logical relationship between the data, so when ADOQuery1, POST, ADOQuery2 will POST
For example:
ADOQuery1. POST;
ADOQuery2. POST;
So if ADOQuery1, after POST, host power, then ADOQuery2 cannot POST
So, can you let them at the same time POST
Similar to this: ADOQuery1 and ADOQuery1 POST
Purpose is either all POST, or no,
CodePudding user response:
Using ado transactionFirst confirm query1 and query2 adoconnection connection is the same, the code is roughly as follows:
ADOConnection1. BeginTrans;//start transaction
Try
//post1
//post2
//post3
ADOConnection1.Com mitTrans;//to commit the transaction
Except,
On E: the Exception do
The begin
ADOConnection1. RollbackTrans;//transaction rollback
end;
end;