Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
winz
Starting Member
5 Posts |
Posted - 2003-05-20 : 06:32:11
|
| I really wonder about the Transaction:Condition A:con.BeginTranscon.Execute "Update [Names] Set Name = 'kong' Where ID = 20", RecordsEffectedcon.Execute "Update [invalidTable] Set Name = 'wong' Where ID = 28", RecordsEffectedCondition Bcon.BeginTranscon.Execute "Update [invalidTable] Set Name = 'wong' Where ID = 28", RecordsEffectedcon.Execute "Update [Names] Set Name = 'kong' Where ID = 20", RecordsEffectedIf con.Errors.Count > 0 Thencon.RollbackTransResponse.Write "Transaction Rollback" & err.DescriptionElsecon.CommitTransResponse.Write "Transaction Commit & Record Effected is :" & RecordsEffectedEnd If1.) If in condition A, the con.Errors.Count can't catch the Error, and commit the transaction, but In condition B it be able to catch the error and rollback the transactionPls help...WHY |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-05-20 : 08:17:46
|
| Don't do transactions in ADO. Rewrite this code as a stored procedure and use server-side transactions only. |
 |
|
|
|
|
|