hi there...
can anyone help me?
i'm trying to create a program that will save the information that i insert into xml files using asp.
but, there is an error occur when i'm trying to save the data.
this is my code:
<%
Function SaveData(strXMLFilePath, strFileName)
'Declare local variables.
Dim objXML
Dim objRoot
Dim objField
Dim objFieldValue
Dim objattID
Dim objattTabOrder
Dim objPI
Dim x
Set objXML = server.CreateObject("Microsoft.XMLDOM")
objXML.preserveWhiteSpace = False
Set objRoot = objXML.createElement("Resource_Repository")
objXML.appendChild objRoot
Set objResource = objXML.createElement("Resource")
Set objText = objXML.createElement("text")
objText.Text = Request.Form("description")
objResource.appendChild objText
Response.Write(objText.Text)
Set objLink = objXML.createElement("Link")
objResource.appendChild objLink
Set objUrl = objXML.createElement("url")
Set objLineText = objXML.createElement("linetext")
objLineText.Text = Request.Form("title")
objLink.appendChild objLineText
Set objSize = objXML.createElement("Size")
objSize.Text = Request.Form("size")
objResource.appendChild objSize
objXML.insertBefore objPI, objXML.childNodes(0)
objXML.save strXMLFilePath & "\" & strFileName
Set objRoot = Nothing
Set objResource = Nothing
Set objText = Nothing
Set objLink = Nothing
Set objUrl = Nothing
Set objLineText = Nothing
Set objSize = Nothing
End Function
On Error Resume Next
SaveFormData "C:\Inetpub\wwwroot\website\xml\5\","resources.xml "
If err.number <> 0 then
Response.write("Errors occurred while saving data.")
Else
Response.write("<center><h2>Data Entry Successful</h2><P>The resource has been successfully added in the database.</center> ")
End If
%>
i don't have any idea how to solve it..