none
SelectSingleNode fails with MSXML2.DOMDocument60 but not with MSXML2.DOMDocument26 and below

    Question

  • I have a webservice that returns the following XML:
     
     
    Code Snippet
    <CntrDatePriority xmlns="http://myproject.mycompany.com">
     <ContractualShipDate>10/31/2008</ContractualShipDate>
     <Priority>Normal</Priority>
    </CntrDatePriority>

     

     

    When I attempt to retrieve the ContractualShipDate as below in my Access 2003 ADP VBA, I get no ParseError. But I get the dreaded and much disliked -  "Object variable or With Block Variable Not Set" error.
     
    Code Snippet
     
    Dim xmlResult As New MSXML2.DOMDocument60
    Dim objNode As IXMLDOMNode
    xmlResult.LoadXml (MyWebServiceObject.WebMethod())
    Set objNode = xmlResult.documentElement.selectSingleNode("ContractualShipDate")
    ProdDate = objNode.Text

     

     

    It fails even with MSXML2.DOMDocument40.
     
    However it works for MSXML2.DOMDocument and MSXML2.DOMDocument26
     
    Please help me understand this. Thank you.
    Monday, October 27, 2008 3:51 PM

All replies

  • Please Check your reference items in VBE.(tools--references--refereneces dialogs box)

    And what is your IE version?

    So, I thought there were two possible situations:

    1. if you set the reference: Microsoft XML, v2.6 or v3.0

    2. if your IE is too old to suport v4.0 or above

     

     

    Wednesday, October 29, 2008 1:11 PM
  •  

    Thank you for responding.

     

    IE version is 7, OS - XPSP2 with all the latest service packs and updates.

    Access 2003.

     

    I set the reference to MS XML 6. 

    Wednesday, October 29, 2008 2:37 PM
  • You get any solution for this query.
    I change my reference to ms xml 6 is there any disadvantage.


    Rgrds, Brijraj Rathod http://accessvbadeveloper.wordpress.com
    Tuesday, February 09, 2010 7:55 AM