INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Distributed transaction with ADO + VB6

Distributed transaction with ADO + VB6

(OP)
There was some sample code posted here in another thread, the code is below. It looks like the code I need except as it was posted it does not work, on     "ObjContext.SetComplete" you get error 91 object not set. Does anybody know how to make this work.

I am trying to figure how to do a transaction that would be for 2 different adodb datasources into just 1 transaction.



Code from thread330-301156: 2 phase commit


Dim objDOCodes As New clsDOCodes
    Dim ObjContext As ObjectContext

    Set ObjContext = GetObjectContext()
   'Do what ever code for ur insertion in the lines below
   'i am pasting some dummy code for ur ease
   
    Dim objCmdTask As New ADODB.Command
    
    
    With objCmdTask
        .CommandType = adCmdStoredProc
        Set .ActiveConnection = DBConnection(varInfo  (INT_CONNECTSTRING))
        .CommandText = STR_STP_ORD_INSERT_TASK
                
        .Parameters.Append .CreateParameter  (STR_PRM_ORD_TASKREMINDER_DESC, adVarChar, adParamInput, 255, mstrTaskDescription)
        .Execute
        
    End With

    ObjContext.SetComplete
    Exit Function
ErrH:
    ObjContext.SetAbort
    Err.Raise Err.Number, Err.Source, Err.Description

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close