H
harvinder singh
Hi
I am trying to get the XML out of my Microsoft Access database, I am
able to get the records from the database however not in the XML format.
below is the ASP code for the same. What could be the problem.
<%@ language=JScript %>
<%
Response.ContentType = "text/xml"
var lobjXMLData = Server.CreateObject("Microsoft.XMLDOM")
lobjXMLData.async = false
var pobjRecordset = Server.CreateObject("ADODB.Recordset");
var sSQL , sConn;
sSQL = "SELECT * FROM Employee"
sConn= "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\SRR\\SRR.mdb"
pobjRecordset.Open(sSQL, sConn);
// This commented code works.
/* pobjRecordset.MoveFirst();
while (pobjRecordset.EOF != true)
{
Response.Write(pobjRecordset("EmpId")+pobjRecordset("Name")+"<br>");
pobjRecordset.MoveNext();
}
*/
Response.Write("<?xml version='1.0' encoding='windows-1252' ?>")
pobjRecordset.save(lobjXMLData, pobjRecordset.adPersistXML)
Response.Write(lobjXMLData.xml);
Response.Write(lobjXMLData.hasChildNodes);
%>
The output that comes is "False"
Regards
Harvinder Singh
I am trying to get the XML out of my Microsoft Access database, I am
able to get the records from the database however not in the XML format.
below is the ASP code for the same. What could be the problem.
<%@ language=JScript %>
<%
Response.ContentType = "text/xml"
var lobjXMLData = Server.CreateObject("Microsoft.XMLDOM")
lobjXMLData.async = false
var pobjRecordset = Server.CreateObject("ADODB.Recordset");
var sSQL , sConn;
sSQL = "SELECT * FROM Employee"
sConn= "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\SRR\\SRR.mdb"
pobjRecordset.Open(sSQL, sConn);
// This commented code works.
/* pobjRecordset.MoveFirst();
while (pobjRecordset.EOF != true)
{
Response.Write(pobjRecordset("EmpId")+pobjRecordset("Name")+"<br>");
pobjRecordset.MoveNext();
}
*/
Response.Write("<?xml version='1.0' encoding='windows-1252' ?>")
pobjRecordset.save(lobjXMLData, pobjRecordset.adPersistXML)
Response.Write(lobjXMLData.xml);
Response.Write(lobjXMLData.hasChildNodes);
%>
The output that comes is "False"
Regards
Harvinder Singh