I'm trying save a ADO recordset to an XML object using the adPersistXML option.
The following is the code I am using :
Response.ContentType = "text/xml"
Dim rsCatalogue
Dim xmlDOM
Call openConnection(DataConn) 'Creates connection to db
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument.3.0"
set rsCatalogue = Server.CreateObject("ADODB.Recordset"
strConn = Application("dbConnect"
Response.Write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCRLF
rsCatalogue.Open "sql statement", strConn
rsCatalogue.Save xmlDOM,adPersistXML
rsCatalogue.Close
Set rsCatalogue=nothing
When I call this from a browser I get the following error:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
XML document must have a top level element.
I checked out loads of examples, and they all seem to follow the same format. I know the ADO recordset is returning values, what am I doing wrong ???
The following is the code I am using :
Response.ContentType = "text/xml"
Dim rsCatalogue
Dim xmlDOM
Call openConnection(DataConn) 'Creates connection to db
Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument.3.0"
set rsCatalogue = Server.CreateObject("ADODB.Recordset"
strConn = Application("dbConnect"
Response.Write "<?xml version=""1.0"" encoding=""ISO-8859-1""?>" & vbCRLF
rsCatalogue.Open "sql statement", strConn
rsCatalogue.Save xmlDOM,adPersistXML
rsCatalogue.Close
Set rsCatalogue=nothing
When I call this from a browser I get the following error:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
XML document must have a top level element.
I checked out loads of examples, and they all seem to follow the same format. I know the ADO recordset is returning values, what am I doing wrong ???