From the ADO help file:
Dim xDOM As New MSXML.DOMDocument
Dim rsXML As New ADODB.Recordset
Dim sSQL As String, sConn As String
sSQL = "SELECT customerid, companyname, contactname FROM customers"
sConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files" & _
"\Common Files\System\msadc\samples\NWind.mdb"
rsXML.Open sSQL, sConn
rsXML.Save xDOM, adPersistADO 'Save Recordset directly into a DOM tree.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Is it possible to get the contents of an ADO recordset returned as XML
> without first persisting it to file?
[quoted text clipped - 7 lines]
> Vancouver, BC
> 604-874-5774
Patrick Jackman - 18 May 2008 22:39 GMT
Thanks Doug.
I also found this on the MS website:
Dim oStream As ADODB.Stream
Set oStream = New ADODB.Stream
oRecordset.Save oStream, adPersistXML
Dim sXML As String
sXML = oStream.ReadText
oStream.Close
Set oStream = Nothing
Patrick.
From the ADO help file:
Dim xDOM As New MSXML.DOMDocument
Dim rsXML As New ADODB.Recordset
Dim sSQL As String, sConn As String
sSQL = "SELECT customerid, companyname, contactname FROM customers"
sConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files" & _
"\Common Files\System\msadc\samples\NWind.mdb"
rsXML.Open sSQL, sConn
rsXML.Save xDOM, adPersistADO 'Save Recordset directly into a DOM tree.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Is it possible to get the contents of an ADO recordset returned as XML
> without first persisting it to file?
[quoted text clipped - 7 lines]
> Vancouver, BC
> 604-874-5774