saving form to xml

Results 1 to 2 of 2

Thread: saving form to xml

  1. #1
    Join Date
    Dec 1969

    Default saving form to xml

    i am having an issue with my web server giving me a 500<BR>if i use my own LOCAL iis, i can use the code with no issues.<BR>i am trying to take a simple form and save it to an .xml file.<BR><BR>my guess is, the server is having a hard time finding the .xml<BR>file to save to. again, since it is on a web server i dont know the full path so im using server.mappath()<BR>any help would b great! thnx in advance &#062; bg<BR><BR><BR>here is the code:<BR>&#060;%<BR> dim objXMLDoc, objCurrNode, objNewNode, objNewText, ename <BR> <BR> Set objXMLDoc = CreateObject("Microsoft.XMLDOM") <BR> objXMLDoc.async = False <BR> <BR> &#039;objXMLDoc.load ("/test/employees.xml")<BR> objXMLDoc.load Server.MapPath("employees.xml")<BR> <BR> if objXMLDoc.ParseError &#060;&#062; 0 then<BR> Response.Write ("Error: Could not get the source")<BR> else<BR> ename = Request("empname") <BR> Set objNewNode = objXMLDoc.createElement("name") <BR> Set objNewText = objXMLDoc.createTextNode(ename) <BR> objNewNode.appendChild(objNewText) <BR> <BR> Set objCurrNode = objXMLDoc.documentElement<BR> objCurrNode.appendChild(objNewNode)<BR> &#039; ("/test/employees.xml")<BR> Server.Mappath("employees.xml")<BR> Set objCurrNode = objXMLDoc.documentElement.lastChild<BR> <BR> Response.Write("Employee &#060;b&#062;")<BR> Response.Write(objCurrNode.xml)<BR> Response.Write(" &#060;/b&#062;has been added sucessfully into the database")<BR> <BR> End if<BR> set objXMLDoc = nothing<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: saving form to xml

    yes, but what&#039;s the actual error? do you have friendly errors enabled in your browser? if so, turn &#039;em off.<BR><BR><BR>j<BR>

Posting Permissions

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