|
-
Jul 27th, 2000, 04:31 AM
#1
Thread Starter
New Member
Whats the best way to implement a (ADO) Rollback
in case there was an unexpected error during processing.
I was trying to put the code in the "ON ERROR GOTO" routine but it says that there was no active transaction....Pls. I need your help.
Tnx in advance.
-
Jul 27th, 2000, 05:09 AM
#2
Member
Did you set the transaction in progress earlier in your code.... i.e.
assuming your connection variable is called cn and recordset is rs.
------------------------------------------------------------
On Error Goto ErrorTrap
sub DoSomething()
cn.begintrans
with rs
.addnew
.fields("txtData") = "test"
'Assume this next field should be an integer it will cause an error
.fields("intData") = "someText"
.update
end with
cn.CommitTrans
Out:
Exit Sub
ErrorTrap:
cn.rollbackTrans
resume Out:
End sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|