Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Periodic error with .loadXML Periodic error with .loadXMLTo: 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
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
