This sample in this article demonstrates how to retrieve an XML document from SQL Server 2000 by using a template file that contains parameters. More specifically, a query is issued against SQL Server 2000 by using an ActiveX Data Objects (ADO) 2.6 command stream. This query fetches the XML
DataStream.
This sample reads the "products.xml" template file from disk and sets the
command text for the
ADODB.Command object for the query to run.
You must set the following properties for the
Properties collection of the
ADODB.Command object:
- Base Path. This property establishes the location of the template and the Extensible Style Sheet Language (XSL) files.
- Output Stream. This property designates where the resulting XML data stream will be piped.
- Dialect. The dialect defines the syntax and the general rules that the provider uses to parse the string or the stream. By setting the command language dialect, you specify how the Microsoft OLE DB Provider for SQL Server interprets the command text that is received from ADO. The dialect is specified by a globally unique identifier (GUID) and is set by using the Dialect property of the Command object.
- XSL. This property transforms the XML document.
NOTE:
Output Stream may be any object that supports an
IStream or
ISequentialStream interface. Objects that support the
IStream interfaces are the
ADODB.Stream object, the Microsoft Internet Information Services (IIS) 5.0
Response object, and a Microsoft XML (MSXML)
DomDocument object.
For more information about SQL Server 2000, see SQL Server Books Online.
For more information on XML, visit the following Microsoft Web site:
For more information about XML, visit the following World Wide Web Consortium (W3C) Web site: