Creating an XML document object in IIS 5.0 W2000 professional wkst

M

Malcolm Reid

I am attempting to open an XML file in an asp on my personal IIS server. The
VBscript code is:
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.Load("bpm.xml")

When I test for errors, I receive this message from the
xmlDoc.parseError.reason property:

reason: System error: -2146697210.

However when I run the same VBscript code on the client it successfully
opens the xml file and away we go. Is there something I need to load or
configure on the IIS server to enable XML DOM processing? What is causing
this error?

Thanks
 
B

Bob Barrows [MVP]

Malcolm said:
I am attempting to open an XML file in an asp on my personal IIS
server. The VBscript code is:
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.Load("bpm.xml")

When I test for errors, I receive this message from the
xmlDoc.parseError.reason property:

reason: System error: -2146697210.

However when I run the same VBscript code on the client it
successfully opens the xml file and away we go. Is there something I
need to load or configure on the IIS server to enable XML DOM
processing? What is causing this error?

Thanks
Sorry, but we can't debug based on an error code which can possibly be used
for several different errors. Maybe a Google for that error code will yield
some meaningful results.

I'm suspecting a file permissions problem given that the code works when you
run it in the client. You need to keep in mind that the user's permissions
may not apply when server-side code is running. Server-side code runs under
the context of the IUSR_machinename account.

You may wish to use code like this to get a better idea of what the error
is:

bStatus= xmldoc.load("bpm.xml")
if bStatus = false then
Set xPE = xmldoc.parseError
strMessage = "errorCode = " & xPE.errorCode & vbCrLf
strMessage = strMessage & "reason = " & xPE.reason & vbCrLf
strMessage = strMessage & "Line = " & xPE.Line & vbCrLf
strMessage = strMessage & "linepos = " & xPE.linepos & vbCrLf
strMessage = strMessage & "filepos = " & xPE.filepos & vbCrLf
strMessage = strMessage & "srcText = " & xPE.srcText & vbCrLf
MsgBox strMessage,,pSource
SubmitXMLvbs=false
exit function
end if

Another possibility that occurs to me is that you are not properly telling
the load method where the file is. If you tell it to open "bpm.xml" in the
client, it's going to look for the file in c:\ - the root. Are you expecting
the load method to treat "bpm.xml" as a filesystem path? Or a url? You ma
want to use a filesystemobject to see if the file exists where you expect it
to be before calling the load method.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top