Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have found your site brilliant. What makes it good are the people that contribute to the site..."

Geography

Where in the world do Tek-Tips members come from?
wakerunner (Programmer)
7 Dec 07 12:13
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

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!

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