F
fxjpost
Unregistered / Unconfirmed
GUEST, unregistred user!
我同時多個表提交時,如有一個表提交時出錯,能把己提交的滾回嗎(當然數據庫連接是正常的),如下:
AdoConnection.BeginTrans;
try
AdoDataSet1.UpdateBatch() ;
AdoDataSet2.UpdateBatch() ;
AdoDataSet3.UpdateBatch() ;
AdoDataSet4.UpdateBatch() ;
AdoConnection.CommitTrans ;
except
AdoConnection.RollbackTrans;
end;
AdoConnection.BeginTrans;
try
AdoDataSet1.UpdateBatch() ;
AdoDataSet2.UpdateBatch() ;
AdoDataSet3.UpdateBatch() ;
AdoDataSet4.UpdateBatch() ;
AdoConnection.CommitTrans ;
except
AdoConnection.RollbackTrans;
end;