Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Periodic error with .loadXML

From: "Patrick Jackman" <pjackman@-----.--->
To: NULL
Date: 6/12/2008 11:18:00 AM

I am using the following code in MSAccess VBA to acquire some XML data. 
Periodically the loadXML call on line 99 returns false. What types of 
conditions could be responsible for this? The code is based on a vendor's 
example. Perhaps it's incomplete?

Any help would be appreciated.

        Dim oXMLHTTP As XMLHTTP    ' is msxml6.dll
        Dim oDoc As DOMDocument
        Dim oList As IXMLDOMNodeList
        Dim oElem As IXMLDOMElement
        Dim oNode As IXMLDOMNode
        Dim strError As String
        Dim strEDocPath As String
        Dim strEDocFile As String
        Const cErrInTUResponse = 65210
        Const cErrResourceNotFound = -2146697211
83
86     Set oDoc = New DOMDocument
87     oDoc.async = False
        ' cbfXML returns a well formed XML document
88     oDoc.loadXML cbfXML()
89     If (oDoc.parseError.ErrorCode <> 0) Then
90         Err.Raise oDoc.parseError.ErrorCode, Me.Name & ".cbfReport", 
oDoc.parseError.Reason & "; " & oDoc.parseError.srcText
91     End If
92
        ' post and get the reply
94     Set oXMLHTTP = New XMLHTTP
95     Call SysCmd(acSysCmdSetStatus, "Connecting...")
96     oXMLHTTP.Open "POST", "https://RemovedForDiscussion", 0
97     Call SysCmd(acSysCmdSetStatus, "Waiting...")
98     oXMLHTTP.Send oDoc
       DoEvents
99     If Not oDoc.loadXML(oXMLHTTP.responsexml.xml) Then
100         strError = "An unexpected error occured. LoadXML failed. "
101         Error cErrInTUResponse
102     Else
            ' check that the document loaded
104         If oDoc.documentElement Is Nothing Or Len(oDoc.xml) = 0 Then
105             strError = "An unexpected error occured. Nothing was 
returned. "
106             Error cErrInTUResponse
107         End If

Patrick
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Patrick Jackman
Vancouver, BC
604-874-5774 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent