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
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