troubleshooting Question

Getting error 2146697208 when sending an XML document

Avatar of dcsweb
dcsweb asked on
XMLVisual Basic Classic
4 Comments1 Solution10166 ViewsLast Modified:
I am sending multiple XML requests to another server and at some point (which differs every time I run it), I will get "Error: -2146697208 The download of the specified resource has failed."  I have XML requests stored in a database and am using VB 6.0 to send them to another server, looping through each one. Sometimes I can only send 2 requests before I get this error, sometimes 10, sometimes more. I have determined that it dies on the "myxml.Send mydoc" statement and I am at a complete loss as to what causes this error and how to fix it.
Set myxml = CreateObject("Microsoft.XMLHTTP")
    Set myxsl = CreateObject("MSXML2.DOMDocument")
    myxsl.Load ("myfile.xsl")
    Set mydoc = CreateObject("MSXML2.DOMDocument")
    CommandText = "Select <<fields>> From <<table>>"
    Set qry = DBConn.Execute(CommandText, , adCmdText)
    If qry.BOF And qry.EOF Then
        Do While Not qry.EOF
            'myXMLquery is defined here
            mydoc.loadXML myXMLquery
            Dummy = LogIt("mydoc.loadXML loaded")
            If mydoc.parseError.ErrorCode Then
                Dummy = LogIt("mydoc.parseError.ErrorCode = " & mydoc.parseError.ErrorCode)
                myxml.Open "GET", "http://<<otherserver>>", False
                Dummy = LogIt("myXML.Open successful")
                myxml.setRequestHeader "Content-type", "text/xml"
                myxml.Send mydoc
                Dummy = LogIt("XML document sent")
                Set myresponse = myxml.responseXML
                Dummy = LogIt("XML response received")
                'now process the response
                myresponse.transformNodeToObject myxsl, mydoc
                'results stored in a database here
            End If
    End If
    Set qry = Nothing
    Set mydoc = Nothing
    Set myxml = Nothing
    Set myxsl = Nothing
    Set myresponse = Nothing

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros