Click here to generate a table from the data in the recordset:
Code:
<%
dim sXML, cn, rs, sSQL,arData,arNames,xmldoc
'Insert your database server details:
set cn = server.CreateObject("ADODB.Connection")
cn.Open Application("ConnectionString")
sSQL = "Select CompanyName,ContactName,City FROM Northwind..Suppliers"
set rs = cn.Execute(sSQL,,adCmdText)
set xmldoc = Server.CreateObject("msxml2.domdocument")
rs.save xmldoc, adPersistXML
rs.Close
set rs=nothing
cn.Close
Set cn = Nothing
'the following line eliminates whitespace and handles
'literal quotes
sXML = replace(replace(xmldoc.xml,vbCrLf,""),"""","""""")
set xmldoc = nothing
%>
Xml Recordset Server2Client by Bob Barrows
Xml Recordset Server2Client by Bob Barrows
Click here to generate a table from the data in the recordset: