:: Forum >>

ASP Recordset Save xml example? v2.0

I am using this code:

rstData.Open strSQL, DataConn, adOpenForwardOnly, adLockReadOnly, adCmdText

Dim objXMLDOM, schemaNode
Set objXMLDOM = CreateObject("Microsoft.xmldom")
rstData.Save objXMLDOM, adPersistXML

With objXMLDOM

.setProperty "SelectionNamespaces", _
"xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'"
Set schemaNode = .selectSingleNode("//s:Schema")

With .documentElement
.removeChild schemaNode
.removeAttribute "xmlns:s"
.removeAttribute "xmlns:dt"
.removeAttribute "xmlns:rs"
End With

.Save Server.MapPath("z.xml")
End With

rstData.Close


but the xml comes out looking like this:
<xml xmlns:z="#RowsetSchema">
<rs:data xmlns:rs="urn:schemas-microsoft-com:rowset">
<z:row ROW="[&quot;5028/35&quot;,&quot;Mentor-Protege Program&quot;,&quot;, &quot;,&quot;3&quot;,&quot;comet&quot;,&quot;599&quot;,&quot;106940&quot;,&quot;N04-MN-308&quot;,&quot;Sep 30 2003 12:00AM&quot;,&quot;May 30 2006 12:00AM&quot;,&quot;TM&quot;,&quot;420159.00&quot;,&quot;420159.00&quot;,&quot;0.00&quot;,&quot;0.00&quot;,&quot;0&quot;,&quot;10/11/2005&quot;,&quot;0&quot;,&quot;Sep 8 2005 12:00AM&quot;,&quot;auto-inserted from certified EAC&quot;],"/>
<z:row ROW="[&quot;5028/36&quot;,&quot;JWFC IT Systems Engineering Support&quot;,&quot;, &quot;,&quot;&quot;,&quot;&quot;,&quot;599&quot;,&quot;100718&quot;,&quot;N04-CN-170&quot;,&quot;Mar 12 2003 12:00AM&quot;,&quot;Oct 31 2003 12:00AM&quot;,&quot;CPFF FPH&quot;,&quot;134876.00&quot;,&quot;134876.00&quot;,&quot;0.00&quot;,&quot;0.00&quot;,&quot;0&quot;,&quot;&quot;,&quot;0&quot;,&quot;&quot;,&quot;&quot;],"/>

any ideas how to format the XML to make it work??
I realize I could use a data island, but I think you have to parse the entire recordset in order to do that. This method creates an xml file or a stream in memory.

What I would really like to see is an example creating the stream in memory and using it to create a grid.

Any Ideas??
Jim Shaffer
Wednesday, October 19, 2005

This topic is archived.


Back to support forum

Forum search