MSXML2 Access Denied Error

admin

Administrator
Staff member
im trying to write a recordset in asp to an xml file. however... upon XMLDOC.SAVE call.. i get an MSXML4.DLL ACCESS DENIED error. ive read a lot of articles in the web on how to go around this problem. ive done all of them but i still get the same access denied error. as a reference.. here are the things that ive done:
1. added write permission to the folder where i write the xml file.
2. added write permision to IUSR in IIS
3. updated msxml3 to msxml4 sp2.

can anybody please help me. was i doing something wrong??? here goes my code:

set cn = server.CreateObject("adodb.connection")
cn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb;Persist Security Info=False"
cn.open

'CREATE XML FILE
dim xmlDoc
set xmlDoc = server.CreateObject("MSXML2.DOMDocument.4.0")

if (xmlDoc.childNodes.length = 0) then
set root = xmldoc.createNode("element", "Northwind", "")

xmldoc.appendchild(root)

set rs = cn.Execute("spGetEmployees")
while not rs.eof
set onode = xmldoc.createNode("element", "Employee", "")
xmldoc.documentElement.appendchild(onode)

set inode = xmldoc.createNode("element", "ID", "")
inode.text = rs.fields(0)
onode.appendchild(inode)

set inode = xmldoc.createNode("element", "FirstName", "")
inode.text = rs.fields(1)
onode.appendchild(inode)

set inode = xmldoc.createNode("element", "LastName", "")
inode.text = rs.fields(2)
onode.appendchild(inode)
rs.movenext
wend
set rs = nothing
end if
strPath = Server.MapPath("/tstsvr/")
xmldoc.save "c:\test.xml" 'strPath & "saved.xml"
 
Back
Top