How to return a XMLDom object forom classic asp function

40 views Asked by At

I am working on a legeacy application where I need to return xmldom object from a classic asp function, here is my code, but gives me belwo error. not sure where I;m wrong.

Microsoft VBScript runtime error '800a01b6' Object doesn't support this property or method application_functions.asp, line 9478

code goes here...

Function ExecuteStoredProcedureReturnXmlLocal(p_sStoredProcedureName,p_lReturnValue)
   Dim oXmlDom
    Dim sXML
    Dim sXMLElement
    Dim sFieldValue
    Dim oRecordset
    Dim oField
    Dim p_vXmlField
    Dim p_vAttribute 

    p_vAttribute = 1
    
    With g_oDataTier
         Set oRecordset = .ExecuteStoredProcedureReturnRecordSet( _
                p_sStoredProcedureName, _
                g_iReturnValue)    
            Call .ClearParameters

    End With

    p_lReturnValue = g_iReturnValue
    
    'Build XML From Recordset
    sXML = "<DATA>"
    Do While Not oRecordset.EOF
        ''''some code goes here.. I cann't post here
    Loop
    sXML = sXML & "</DATA>"

    Set oRecordset = Nothing
    'Load XML Into A DOM
    'oXmlDom.loadXML sXML
    'sXML
     Set oXmlDom = Server.CreateObject("MSXML2.DOMDocument.6.0") 
    oXmlDom.async = False 
        
    oXmlDom.loadXML(sXML)
    ExecuteStoredProcedureReturnXmlLocal = oXmlDom -- this is the line no 9478
    
End Function

tried so many option but no luck appreciated the help. Thanks

0

There are 0 answers