Tip Important Facts about ADO Recordsets

An ADO recordset can be saved directly to an XML file.

Dim rst As ADODB.Recordset Set rst = New ADODB.Recordset object so you don't need to first save to a stream and then load that stream into the DOM. This method is faster and more scalable.

rst.Save "C:\myfile.xml", adPersistXML

An ADO recordset can be saved directly to the Stream object so XML does not have to be saved in a physical file before you can work with it. Dim rst As ADODB.Recordset Dim myStream As ADODB.Stream Set rst = New ADODB.Recordset Set myStream = New ADODB.Stream

Dim rst As ADODB.Recordset Dim myDom As MSXML2.D0MDocument30 Set rst = New ADODB.Recordset Set myDom = New MSXML2.D0MDocument30

rst.Save myDom, adPersistXML

An ADO recordset can be saved directly into the ASP Response object.

Dim rst As ADODB.Recordset Set rst = New ADODB.Recordset rst.Save myStream, adPersistXML

An ADO recordset can be saved directly into the XML DOMDocument

Rst.Save response, adPersistXML

0 0

Post a comment