Using ADO with the SQL Native Client
(Page 1 of 4 )
SQL Native Client is a new data access method from Microsoft. It boasts its own dynamic link library. This extends the capabilities of ADO on the SQL Server. This article explores two aspects of this method.
Introduction
In an earlier article one of the new features of SQL 2005, namely the Multiple Active Result Sets (MARS) was described with an example where the SQL Native Client OLEDB provider was used. In SQL 2005 Server a new data type, the XML data type, was also added. If you ever need to leverage the new features of SQL 2005 Server in your application, you should consider using the SQL Native Client as the data access provider.
The SQL Native Client is contained in a single dynamic link library and supports both OLEDB and ODBC interfaces. However the names of these interfaces are different from those used in MDAC. The SQL Native Client supports the For XML clauses in the queries as well as the XML data type.
In this tutorial two items are explored. First, the methods of connection and command objects when the ADO accesses the database with the SQL Native Client provider are described with an example. Second, an example of connecting to the SQL 2005 server with this provider to execute a "for XML query" and display it with the web browser object is described.
Again as in the previous tutorial, an MS Access platform will be used in the examples, which necessitates using a form and a command button. The ADO will provide the data from the SQL 2005 Server, the FileSystemObjects takes it to the intranet web root and the web browser will navigate to the intranet URL to display the returned data.
Next: Adding Library References and ActiveX Objects >>
More Database Articles
More By Jayaram Krishnaswamy