Interview Question in SQL Server 2000


 

Interview Question :: The Load Method for the DOM Failed


I'm using VB6 and ASP 3 with SQL Server 2000 - trying to get xml but when I run code I'm getting "The Load Method for the DOM Failed" I checked all my database connections are correct all refrences seems ok my code is following


Dim objXMLDoc As MSXML2.DOMDocument40
Set objXMLDoc = New MSXML2.DOMDocument40
objXMLDoc.async = False

'Load the location of the template
objXMLDoc.Load (m_sXMLPath &
XslTmpltUsgSprocNstd)


Thanks
Raza Shah
Answers to "The Load Method for the DOM Failed"
RE: The Load Method for the DOM Failed?

Your code looks fine. Is XslTmpltUsgSprocNstd a valid XML file? Are you sure you're setting a reference to Microsoft XML, v4.0? I'm not sure what you mean by database connections since this code reads the xml document. You mean references? Are you trying to load the xml file into a sql server 2000 table?



Try this to get a better error message:



If objXMLDoc.Load(m_sXMLPath & slTmpltUsgSprocNstd) Then

MsgBox objXMLDoc.xml

Else

MsgBox "Error: " & objXMLDoc.parseError.reason

End If



It sounds like you've got an invalid xml file or you don't have all the references set correctly (or all the components installed).
 
Vote for this answer ::  
Update Alert Setting