Article ID: 271780 - Last Review: August 9, 2004 - Revision: 4.4 SAMPLE: How To Retrieve XML Data Using an SQL XML Query with ADO in Visual C++This article was previously published under Q271780 On This PageSUMMARY XMLStream.exe demonstrates how to create an ActiveX Data
Objects (ADO) client that uses an SQL XML query to extract an XML stream from a
SQL Server 2000 server. MORE INFORMATION This sample requires the client to connect to a SQL Server
2000 server by using the Microsoft OLE DB Provider for SQL Server that ships
with Microsoft Data Access Components (MDAC) version 2.6 or later only. Prior
versions of SQL Server always returned data in some form of a recordset as a
result of executing a 'SELECT..' SQL statement. In SQL Server 2000, the 'SELECT
...' SQL Statement has been enhanced to include a new FOR XML clause, frequently called an SQL XML query. This clause allows
SQL Server to return data in the form of an XML document. In addition, the ADO Command object has been enhanced to configure and retrieve XML data as a result of executing "SELECT ... FOR XML" SQL queries. XMLStream.exe provides an example that does the following:
Steps to Run the Sample
XMLStream.exe
(http://download.microsoft.com/download/vc60std/sample2/6.0/w9x2k/en-us/xmlstream.exe)
Release Date:
September 27, 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 XMLStream.exe file contains the following files:
Collapse this table
REFERENCESFor additional information on XPATH query and XML , click the
article numbers below to view the articles in the Microsoft Knowledge Base: 272177
(http://support.microsoft.com/kb/272177/EN-US/
)
SAMPLE: How to Retrieve XML Data in VC++ Using an XPATH Query
272185
(http://support.microsoft.com/kb/272185/EN-US/
)
SAMPLE: How to Retrieve Data Using a SQL XML Query in ATL OLE DB
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++
272180
(http://support.microsoft.com/kb/272180/EN-US/
)
SAMPLE: How to Retrieve XML Data Using a Template File with ADO in Visual C++
Microsoft SQL Server 2000 Books OnlineADO 2.6 Documentation APPLIES TO
| Article Translations
|
Back to the top
