Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distributed transaction with ADO + VB6

Status
Not open for further replies.

wakerunner

Programmer
Dec 7, 2007
1
0
0
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


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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top