Article ID: 272180 - Last Review: August 5, 2004 - Revision: 5.5 SAMPLE: How to Retrieve XML Data Using a Template File with ADO in Visual C++This article was previously published under Q272180 On This PageSUMMARY XMLTemplate.exe demonstrates how to extract an XML stream
from a SQL Server 2000 database using an XML Template file and the ADO Command object. MORE INFORMATIONThe
following file is available for download from the Microsoft Download
Center: XMLTemplate.exe
(http://download.microsoft.com/download/mdac26/sample05/2.7/win98/en-us/xmltemplate.exe)
Release Date: Jan. 6,
2000For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most
current virus-detection software that was available on the date that the file
was posted. The file is stored on security-enhanced servers that help to
prevent any unauthorized changes to the file.
The XMLTemplate.exe file contains the following files: Collapse this table
This sample shows how an ADO client can run a SQL Server XML query stored in a template file and retrieve the XML data from a SQL Server 2000 database by using the Microsoft OLE DB Provider for SQL Server (SQLOLEDB) that ships with MDAC 2.6 or later. The template file, Products.xml, contains the following parameterized SQL XML query: The sample configures an input XML stream through an ADO Stream object, runs the SQL XML query through an ADO Command object, and then retrieves the output XML stream in an ADO Stream object. Depending on whether or not the XSL stylesheet Products.xsl is used for processing, the output XML stream the output files generated are:
The sample does the following:
Steps to Run the Sample
REFERENCES271780
(http://support.microsoft.com/kb/271780/EN-US/
)
SAMPLE: How To Retrieve XML Data using a SQL XML Query with ADO in Visual C++
271782
(http://support.microsoft.com/kb/271782/EN-US/
)
SAMPLE: How To Retrieve XML Data Using an XPATH query with ADO in Visual C++
271775
(http://support.microsoft.com/kb/271775/EN-US/
)
SAMPLE: HowTo Retrieve Relational Data Using OpenXML with ADO in Visual C++
Microsoft SQL Server 2000 Books OnLineADO 2.6 Documentation APPLIES TO
| Article Translations
|
Back to the top
