
December 5th, 2000, 12:21 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
need help with Connect.RollbackTrans & error handling
<i><b>Originally posted by : Thomas (le835ta@yahoo.com)</b></i><br /><br />When inserting data into a SQL7 database I wrote the following code to notify the user when an error occurred, and then rollback the transaction. <br /><br /><br />>Connect.BeginTrans<br />><br />>Connect.Execute finalSQLStmt<br />><br />>if Connect.Errors.Count <> 0 Then<br />> Response.Write "<p>an error occured</p>"<br />> Connect.RollbackTrans<br />>else<br />> Response.Write "<p>Data has been updated</p>"<br />> Connect.CommitTrans<br />>end if<br /><br />This seems to work pretty well but when I try to insert a chr into an int field, Connect.Errors does not capture the error. It will jump into the else statement and try to commit the transaction. Any ideas on why this happens? Thanks
|