Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

Team - had an issue with Access VBA - got Access denied error. I seem to have resolved it with further help from other posts. This code lets extract an XML and read its attributes. I have reduced the code as am not able to post otherwise:

Sub test()

Dim Queue As String
   Dim aid As String
   Dim tp As String
...

 DoCmd.SetWarnings False
Dim xmlhttp As MSXML2.xmlhttp
Dim xmldoc As MSXML2.DOMDocument
Dim XMLNodes As MSXML2.IXMLDOMNodeList
Dim xmlElement As MSXML2.IXMLDOMElement
Dim bookTitle As String

' Fetch the XML
Set xmlhttp = CreateObject("Microsoft.xmlHTTP")
xmlhttp.Open "Get", "http://....xml", False
xmlhttp.send

' Create a new XMLDocument to which to load the XML text
Set xmldoc = New DOMDocument
xmldoc.loadXML (xmlhttp.responseText)

For Each n In xmldoc.selectNodes("*")

    ts = n.Attributes.getNamedItem("ts").Text

    Next

    For Each n In xmldoc.selectNodes("//myNode")


    Queue = n.Attributes.getNamedItem("cq").Text
    aid = n.Attributes.getNamedItem("id").Text
    tp = n.Attributes.getNamedItem("tp").Text
    astate = n.Attributes.getNamedItem("as").Text
    rc = n.Attributes.getNamedItem("rc").Text


      i = i + 1
    Next
   DoCmd.SetWarnings True
End Sub
share|improve this question
    
Where is the error and please show the appropriate Error Number and exact Error Description. – PaulFrancis Aug 1 '14 at 13:10
    
Hi Paul - thanks :Run Time Error '-2147024891(80070005), Access is denied when i tried to load directly by includign the URL withint he quotes xmlDoc.loadXML("http://.....xml") , i get the error "Attempt to modify a readonly node" – chris.cs Aug 1 '14 at 13:28
    
I tried with another XMl feed from bbc and it did not throw this error. – chris.cs Aug 1 '14 at 13:33
    
The code works fine when i download the xml into a local folder. The webserver requires username/password. Any pointers will be appreciated. – chris.cs Aug 1 '14 at 15:32
    
I built this based on another thread answered by @GSerg [stackoverflow.com/questions/16538329/… - it worked fine yesterday. – chris.cs Aug 1 '14 at 19:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.