Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading XML with DOM Quit working

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,212
US
So the if statement in red below has never evaluated true for importing some particular XML files but now does...

I am guessing there is some evil effect in some security updates but I don't have time to dig deep at the moment. Also noteworthy is that copying a file with the file scripting object is also throwing a permission error.

Any root cause or alternative method advice would be greatly appreciated...

What the code does in what is not seen is it loops through the nodes and breaks the data into tables and populates keys and FK's in the predefined tables for the layout.

Code:
Sub LoadXML(strFile As String, lngFI_ID As Long)
     Dim oDoc As MSXML2.DOMDocument
     Dim fSuccess As Boolean
     Dim oRoot As MSXML2.IXMLDOMNode
     Dim oDomNode As MSXML2.IXMLDOMNode
     Dim RootRS As DAO.Recordset
    
     Dim oChildren As MSXML2.IXMLDOMNodeList
     Dim oChild As MSXML2.IXMLDOMNode
          
     On Error GoTo HandleErr
      Set oDoc = New MSXML2.DOMDocument
      ' Load the  XML from disk, without validating it. Wait
     ' for the load to finish before proceeding.
     oDoc.async = False
     oDoc.validateOnParse = False
     fSuccess = oDoc.Load(strFile)
      ' If anything went wrong, quit now.
     [red]If Not fSuccess Then
       GoTo ExitHere
     End If[/red]
     ....
[Code]
 
Oops just noticed the bad TGML tag...

Code:
Sub LoadXML(strFile As String, lngFI_ID As Long)
     Dim oDoc As MSXML2.DOMDocument
     Dim fSuccess As Boolean
     Dim oRoot As MSXML2.IXMLDOMNode
     Dim oDomNode As MSXML2.IXMLDOMNode
     Dim RootRS As DAO.Recordset
    
     Dim oChildren As MSXML2.IXMLDOMNodeList
     Dim oChild As MSXML2.IXMLDOMNode
          
     On Error GoTo HandleErr
     Set oDoc = New MSXML2.DOMDocument
     ' Load the  XML from disk, without validating it. Wait
     ' for the load to finish before proceeding.
     oDoc.async = False
     oDoc.validateOnParse = False
     fSuccess = oDoc.Load(strFile)
      ' If anything went wrong, quit now.
[red]
     If Not fSuccess Then
       GoTo ExitHere
     End If
[/red]

....
 
I believe the person using this found a non-Access solution to this.... So anyone else having this issue, I have not resolved it. As a curiosity I'd like to at least understand what is going on but as a matter of priorities I doubt I'll be looking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top