dear tapks
okay i am posting a snippet of code which help u out
u don't have to worry about the 2 databse it will be done by MSDTC and Components Service and code of 'SetAbort' and 'SetCOmmit' ,'SetAbort' for aborting the whole transaction no matter if it is inserting in 2 differnt databse servers and 'SetComplete' will do a safe atomic transaction i hope u got it..here is the code
On Error GoTo ErrH
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
Hope the above code will help u
but if u still have some q i am here
Regards
Nouman