How To Retrieve XML Data with a Template File from a Visual Basic Client (271621)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
- Microsoft SQL Server 2000 (all editions)
- Microsoft XML 2.6
- Microsoft XML 3.0
- Microsoft XML 4.0
This article was previously published under Q271621 SUMMARY
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.
REFERENCES
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:
Modification Type: | Minor | Last Reviewed: | 11/22/2005 |
---|
Keywords: | kbhowto KB271621 |
---|
|