I'm new to this XML stuff and I want to run a simple project and that is to retreive data from an XML file and place it into and Access database.
Please help:)
I'm sorry if this is not posted in the correct area
Printable View
I'm new to this XML stuff and I want to run a simple project and that is to retreive data from an XML file and place it into and Access database.
Please help:)
I'm sorry if this is not posted in the correct area
<% @language=vbscript%>
<%
Set objXML = Server.CreateObject("MsXML.DOMDocument")
objXML.Load ("c:\xmlNames.txt")
Dim nNames
Dim eName
Dim iCount
Set oConn = CreateObject("Adodb.Connection")
Set oRs = CreateObject("Adodb.Recordset")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\abhijit\xmlDB.mdb;Persist Security Info=True"
oRs.Open "Select * From Celebs", oConn, 3, 3
Set nNames = objXML.selectNodes("//NAME")
For iCount = 0 To nNames.length - 1
Set eName = nNames.Item(iCount)
oRs.AddNew
oRs.Fields("sFirstName") = eName.getAttribute("Value")
oRs.Update
Next
%>
The XML Message is as follows.
<NAMES>
<NAME Value="John Lennon"/>
<NAME Value="Madonna"/>
<NAME Value="Ronan Keating"/>
<NAME Value="Geri Halliwell"/>
</NAMES>
You will need to put it in the text file.
-Abhijit
:rolleyes: