|
-
Jul 21st, 2003, 10:55 AM
#1
Thread Starter
New Member
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!!!
-
Jul 21st, 2003, 02:04 PM
#2
No, only connection A rolls back 
If you want them both to roll back then use the same connection object.
Woka
-
Jul 21st, 2003, 02:05 PM
#3
Member
You have to use the same connection. What happens in Connection A has nothing to do with Connection B (and vica versa).
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
|