Platform SDK: Transaction Server

SetAbort, SetComplete Methods Example

[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]

Dim ctxObject As ObjectContext
Set ctxObject = GetObjectContext()
On Error GoTo ErrorHandler

' Do some work here. If the work was successful,
' call SetComplete.
ctxObject.SetComplete
Set ctxObject = Nothing
Perform = 0
Exit Function

' If an error occurred, call SetAbort in the error 
' handler.
ErrorHandler:
    ctxObject.SetAbort
    Set ctxObject = Nothing
    Perform = -1
    Exit Function