MDAC Technical Articles

Saving ADO Recordsets in XML Format

January 2000

By Kamaljit Bath and Dax Hawkins

Summary: Microsoft® ActiveX® Data Objects (ADO) 2.0 allowed you to persist Recordset objects both to and from files in ADTG (Advanced Data Table Gram) format. Using this feature, you could save a Recordset to a disk file and later reopen it from the file. ADO 2.1 extended Recordset persistence by allowing you to persist Recordset objects in XML format, albeit with limited support for XML. ADO 2.1 did not support persistence of hierarchical Recordset objects or persistence of Recordset objects with pending changes.

For ADO versions 2.5 and later, some of these restrictions on XML support have been removed. Furthermore, ADO now allows persistence of both the XML and ADTG formats to any object that supports the COM IStream interface, such as the ADO Stream object, the IIS 5.0 Response object, and the XML DOM Document object. Additionally, this release provides built-in integration between ADO and Active Server Pages (ASP) in Internet Information Server (IIS) 5.0, and between Remote Data Service (RDS) and ASP.

This paper includes the following sections:

The paper assumes that you are familiar with Microsoft Visual C++®, Microsoft Visual Basic®, ADO, OLE DB, COM, and XML.