CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    3

    Saving XML using XMLDOM gives errors

    I am trying to save an XML document by calling the save method on an XMLDOM object. However the save method call fails. I have tried sending in the complete path and also the virtual path but does not work.

    Following is the code:

    Dim str, xmldoc
    Set xmldoc = CreateObject("Microsoft.XMLDOM")
    xmldoc.loadXML Request("strXml")
    If xmlDoc.parseError.errorCode <> 0 Then
    Msg = "The string you entered was not well-formed XML. " & _
    xmlDoc.parseError.reason
    Else
    xmldoc.save(Server.MapPath("saved.xml")) ---- GIVES ERROR
    str = Request("strXml")
    str = Replace(str, Chr(38),"&#38;", 1, -1, 1)
    str = Replace(str, Chr(34),"&#34;", 1, -1, 1)
    str = Replace(str, Chr(46),"&#46;", 1, -1, 1)
    str = Replace(str, Chr(60),"&lt;", 1, -1, 1)
    str = Replace(str, Chr(62),"&gt;", 1, -1, 1)
    Msg = "<P>Your XML string:<BR>" & str & _
    "<BR>has been saved to the server as <A HREF='saved.xml'>saved.xml</A>.</P>"


    Hope someone can help
    Thanx.

  2. #2
    Join Date
    Jul 2002
    Location
    India
    Posts
    505
    If this is the error you are getting

    -----------------------
    msxml3.dll error '80070005'

    Access is denied.

    /tests/xmltest.asp, line 9

    --------------------------

    All you need to do is give the Internet guest account write permission to your application directory.

    Your machine's Internet guest account id will be
    IUSR_<your machine name>

    give this user write permission to the directory by right clicking on the directory name in windows explorer, go to properties -> security
    Select the account and make changes to the access permissions

    If your error is not the same, and this does not solve your problem, do let us know

    Satish

  3. #3
    Join Date
    Apr 2003
    Posts
    3
    Thanx. I shall try that and get back.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured