VB and VBA Users Source Code: Saving an ADO recordset to XML
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Saving an ADO recordset to XML
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Tuesday, April 15, 2003
Hits:
1462
Category:
Database/SQL/ADO
Article:
The following code shows you how to save an ADO recordset to an XML file: 'Purpose : Saves an ADO recordset to an XML file 'Inputs : sPath The destination path and filename to save the file 'Outputs : Returns True on success, else returns False 'Author : Andrew Baker (copyright www.vbusers.com) 'Date : 25/03/2001 'Notes : Function RSToXML(oRs As ADODB.Recordset, sPath As String) As Boolean Dim oStream As ADODB.Stream On Error GoTo ErrFailed Set oStream = New ADODB.Stream oRs.Save oStream, adPersistXML oStream.SaveToFile sPath, adSaveCreateOverWrite Set oStream = Nothing RSToXML = True Exit Function ErrFailed: Debug.Print Err.Description Debug.Assert False RSToXML = False Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder