-
Transaction Processing
Hi Everyone,
I just need some information about Transactions in VB 6.0, so here we go.
Sub Test1()
Dim connA as ADODB.Connection
Set connA = New ADODB.Connection
connA.BeginTrans
....
Code Here
.....
Call Test2
'If no problems then Commit
connA.CommiTrans
' If problems then Rollback
connA.RollbackTrans
End Sub
Sub Test2()
Dim connB as ADODB.Connection
Set connB = New ADODB.Connection
.......
rs.Open str, connB, adOpenKeyset, adLockOptimistic, adCmdText
.......
End Sub
What if an error occurs and i rollback my transaction for connA, does what ever i did with connB still get processed since it falls in between the BeginTrans and the RollBackTrans or do i have to specifically use the same connection?
Any help would much help!!!
-
No, only connection A rolls back :(
If you want them both to roll back then use the same connection object.
Woka
-
You have to use the same connection. What happens in Connection A has nothing to do with Connection B (and vica versa).