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!

COM+ and db-triggers

Status
Not open for further replies.

densorz

Programmer
Nov 28, 2003
3
NL
Recently I'm developing an webservice to replace an existing c/s-application. In the used database are triggers inserted. They all work fine in MS SQLserver and Oracle. But when I now want to call a trigger in COM+ I get the error message (logError):

Error -2147217900 : 01-03-2004 11:20:48
- Description: delRequest(DAT): 'Cannot use SAVE TRANSACTION within a distributed transaction.'

This is what I've got so far in COM+(DAT-component):
Code:
Public Function delRequest(ByVal reqId As String) As Boolean
    Dim strSQL As String
    
    On Error GoTo delRequest_Error
            
    'Create the database objects required .
    Set cnConn = New ADODB.Connection
    ' open the connection
    GetConnection cnConn
    strSQL = getDeleteRequestSQL(reqId)
10  cnConn.Execute strSQL, , adExecuteNoRecords
    
    delRequest = True
    SetComplete
    CloseConnection cnConn
    Exit Function
delRequest_Error:
    CloseConnection cnConn
    SetAbort
    delRequest = False
    'log the error
    logError Err.Number, "delRequest(DAT): '" & Err.Description & "'", Erl()
End Function
Seperate class where I build the sql-string:
Code:
Function getDeleteRequestSQL(ByRef strRequestId As String) As String
    Dim strSQL As String
    strSQL = "DELETE FROM thmld2 WHERE right(hdmcode,8)='" & strRequestId & "'"
    getDeleteRequestSQL = strSQL
End Function
And finally the call from ASP:
Code:
dim objRequestDAT
strMld = request.querystring("melding")
set objRequestDAT = Server.CreateObject("ComWebservice.clsRequestDAT")
boolValue = objRequestDAT.delRequest(strMld)
set objRequestDAT = nothing
How to solve this problem in COM+? Tnx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top