MDAC 2.5 SDK - Technical Articles


 

XML

OLE DB rowsets are self-describing objects that contain data and metadata, created by executing commands against data stores. Because of its self-describing nature, rowset information can be easily represented in XML. Therefore, XML is supported as a streaming and persisting format for rowsets. This opens up the use of rowsets to non-COM platforms: If XML representing structured data can be generated from there, it can be translated into rowsets on other machines and vice versa. This also allows ADO Recordset objects to be transmitted over HTTP as part of standard HTML text.

A new feature to MDAC 2.5 is the ability to use the OLE DB Persistence Provider to save a recordset in XML format to any object that implements the IStream interface, such as the Active Server Pages Response object. This feature eliminates the inefficient step of saving the XML to a file on a disk and then sending that file to the Response object.

The following is a subsection of an XML stream representing rowsets:

<?XML version="1.0" encoding="UTF-8" ?>

<orders>

<schema id="rss">

<elementType id="Customer" occurs="ONEORMORE">

<element href="#NameEntry" occurs="ONEORMORE"></>

<element href="#Order" occurs="ONEORMORE"></>

<element href="#Date"></>

</elementType>

<elementType id="Date"> <pcdata></> </elementType>

<elementType id="NameEntry">

<element href="#FirstName"></>

<element href="#LastName"></>

</elementType>

<elementType id="LastName"> <pcdata></> </elementType>

<elementType id="FirstName"> <pcdata></> </elementType>

</schema>

<Customer>

<NameEntry>

<FirstName>Pierce</>

<LastName>Bronson</>

</NameEntry>

<Order>

<Name>Where the Sidewalk Ends</>

<Author>Shel Silverstein</>

<Price>$5.95</>

<Detail>

<Carrier>United Airlines</>

<SKU>411AAA</>

</Detail>

</Order>

<Date>7/7/97</>

</Customer>

</orders>