XP下出现MSXML3.DLL拒绝访问错误的解决办法

最近我做XML存储的时候老出现这种讨厌的错误。现在把解决经验总结了一下与大家分享。

现象:


解决方法
1,首先确认你的 Save存储方法中填写的是物理绝对路径



举例说明一下,下面这段代码是正确的:

<%
Set objXMLdoc =Server.CreateObject("MSXML.DOMDocument")
objXMLdoc.Async=False
objXMLdoc.ValidateOnParse=False
objXMLdoc.Load(Server.mappath("123.xml"))
If objXMLdoc.ReadyState=4 Then
  If objXMLdoc.parseError.errorCode = 0 Then
    ParseLoad=true
  Else
  Response.Write objXMLDoc.parseError.reason & "Error code: " & objXMLDoc.parseError.errorCode & "Line: "& objXMLDoc.parseError.Line & ", Character: " &  objXMLDoc.parseError.linepos & ", Source: " &objXMLDoc.parseError.srcText & " - " & Now & vbCrLf 
  End If
End If  
objXMLdoc.Save(Server.mappath("123.xml"))
%>


如果你把最后一行写成这样就不正确了:

objXMLdoc.Save("123.xml")


2,其次,必须在IIS中执行一次权限向导
截图说明如下:


下一步:


下一步





下一步


完成

14 comments

  1. Cloudream 说道:

    都是FAT32 没权限-。-
    绝对路径问题,我记得要加\ server.path("\123.xml")
    直接server.path("123.xml")有时取不到(文件不存在时?Hehe

  2. ffgfg 说道:

    sdsada

  3. Wilber Hertweck 说道:

    I just want to tell you that I am just all new to weblog and certainly enjoyed this blog. More than likely I’m going to bookmark your site . You surely have exceptional posts. Kudos for sharing with us your blog.

  4. Inez Filas 说道:

    Hi! Do you use Twitter? I’d like to follow you if that would be okay. I’m definitely enjoying your blog and look forward to new updates.

  5. Federico Ellisor 说道:

    I am actually keen of reading content regarding building up new web site, or even regarding Web optimization.

  6. Luis Gibb 说道:

    Wow! Thank you! I continually needed to write on my blog something like that. Can I include a part of your post to my site?

  7. Jeremy Kingsberry 说道:

    Hello There. I discovered your weblog the use of msn. That is an extremely smartly written article. I will be sure to bookmark it and come back to learn more of your helpful information. Thank you for the post. I will definitely comeback.

  8. Angeline Bendis 说道:

    It’s laborious to search out educated individuals on this topic, however you sound like you understand what you’re speaking about! Thanks

发表评论

电子邮件地址不会被公开。