XML to ADO Recordset and Back again
- From: "Barry Seymour" <bseymour@xxxxxxxxxxx>
- Date: Mon, 28 Apr 2008 14:16:48 -0700
I have a VB6 program that uses a global XML document as it's data store. I
want to convert that XML document to an ADO recordset using ADO 2.7, sort
and filter it, then convert that recordset *back* to an XML document.
My problem occurs when I first open the XML document; the resulting ADO
recordset only has one record. I want to get them all.
Here's the code (Error handling omitted for clarity):
------------------------------------------------------------------------------------------------------------------------
Public Function ADORSFromXML(xmlDoc As MSXML2.DOMDocument40) As
ADODB.Recordset
With xmlDoc
.setProperty "SelectionLanguage", "XPath"
.setProperty "SelectionNamespaces",
"xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'
xmlns:ms='urn:schemas-microsoft-com:xslt'"
End With
Set adoRS = New ADODB.Recordset
adoRS.Open xmlDoc
Set ADORSFromXML = adoRS 'return the recordset
Set adoRS = Nothing
End Function
------------------------------------------------------------------------------------------------------------------------
Does anyone know why I'm only getting one record in my ADO recordset? I've
searched the Tubes high and low and can't find a clue.
Thanks in advance..
Barry
bseymour@xxxxxxxxxxx
.
- Follow-Ups:
- Re: XML to ADO Recordset and Back again
- From: Bob Barrows [MVP]
- Re: XML to ADO Recordset and Back again
- Prev by Date: Random crash when ADO::Connection->close() is called
- Next by Date: Re: Transfer data from Excel to SQL Server
- Previous by thread: Random crash when ADO::Connection->close() is called
- Next by thread: Re: XML to ADO Recordset and Back again
- Index(es):
Relevant Pages
|
|