Adoconnection1. BeginTrans;
Adoconnection1. Execute (sql1);
Adoconnection1. Execute (sql2);
Adoconnection1. Execute (sql3);
Adoconnection1. Execute (sql4);
Adoconnection1. Execute (sql5);
Adoconnection1.Com mitTrans;
, and did not return after execution, application of roll, but many times, you will find, for example, in which a certain sql3 did not succeed, the modified data is not modified, and program at this time also not an exception is thrown, so there would be no rollback
Want to ask is what reason, how to solve, thank you
Hope can be solved, thank you again, if not enough, you can open again,
CodePudding user response:
After a Commit, the corresponding Dataset Query best want to Requery the refresh dataFor example,
Adoconnection1. BeginTrans;
Adoconnection1. Execute (sql1);
Adoconnection1. Execute (sql2);
Adoconnection1. Execute (sql3);
Adoconnection1. Execute (sql4);
Adoconnection1. Execute (sql5);
Adoconnection1.Com mitTrans;
Adoquery1. Requery ();
Adoquery2. Requery ();
.
CodePudding user response:
1, this is the transaction processing, detailed check the SQL statement, whether there are any errors, as long as one is wrong, will not be able to perform any of the SQL,2, there is only one you said, did not perform, unlikely, if appear this kind of problem, should be the MSSQL server software, this may be carried out entirely, sleep, and you missed again display (refresh) data to see,
CodePudding user response:
Update not success doesn't mean must be abnormal, the program itself is no problem, but your program logic may not be complete, not updating success requires certain processing is givenCodePudding user response:
Using SQL SERVER Profiler to track the execution of SQL statementsCodePudding user response:
Whether Sql3 have limited the where clause for executionCodePudding user response: