JavaScript Editor Ajax toolkit     Ajax tutorials 



Main Page

Previous Page
Next Page

6.1. SQL Native Client Programming

Microsoft SQL Server 2005 introduces SQL Native Client, which is designed to simplify native access to data in SQL Server 7.0 or later using either OLE DB or ODBC. SQL Native Client replaces the SQL OLE DB provider and the SQL ODBC driver with a standalone API that combines both the SQL OLE DB provider and SQL ODBC driver functionality into a single DLL. The individual data access technologies are now referred to as SQL Native Client (OLE DB) and SQL Native Client (ODBC). Additionally, SQL Native Client supports new SQL Server 2005 enhancements, as described in Table 6-1.

Table 6-1. SQL Native Client support for new functionality in SQL Server 2005 (continued)

Function

Description

xml data type

Supports the SQL Server 2005 xml data type for columns, variable, parameters, and return types

Large value types

Supports SQL Server large-object data typesvarchar(max), nvarchar(max), and varbinary(max)

User-defined types (UDTs)

Supports using UDTs in the SQL Server database

Multiple Active Result Sets (MARS)

Supports multiple result sets using a single SQL Server connection

Snapshot isolation

Supports snapshot isolation level in SQL Server 2005

Asynchronous operations

Allows methods to return immediately without blocking the calling thread

Database mirroring

Supports mirrored SQL Server 2005 databases

Query notifications

Supports client notifications when result sets are modified

Bulk copy

Supports transferring large amounts of data into or out of SQL Server

Password expiration

Supports handling expired passwords in SQL Server 2005 without administrator involvement


If you are developing a new application or modifying an existing application written in a managed programming language such as C# or VB.NET, you should use a .NET Framework data provider for the database. Use SQL Native Client to access new features of SQL Server 2005 and also to access data sources using OLE DB or ODBC from other applications such as COM-based applications.


SQL Native Client is a separate product from MDAC, but it lets you evolve new data access functionality in applications without changing existing MDAC components. Although SQL Native Client uses MDAC, it is not dependent on a specific version of MDAC and can be used with any version installed with Windows 2000 SP3 or later. SQL Native Client does not include user-accessible functionality that already exists in the base MDAC components, such as connection pooling, ADO support, memory management, or client-side cursor supportit uses MDAC to provide that functionality. MDAC does not support enhancements in SQL Server 2005.

SQL Native Client components are installed by default with SQL Server 2005. These components are described in Table 6-2.

Table 6-2. SQL Native Client components

Component

Description

Directory

SQLNCLI.dll

Contains all SQL Native Client functionality, including both the OLE DB provider and ODBC provider.

<windows>\system32

SQLNCLIR.rll

The resource file for SQLNCLI.dll.

<windows>\system32

SQLNCLI.h

Contains all definitions needed to use SQL Native Client. Replaces both the ODBCSS.h and SQLOLEDB.h header files.

Program Files\Microsoft SQL Server\90\SDK\Include

SQLNCLI.lib

The library file needed to call the ODBC Bulk Copy Program (BCP) functions in SQL Native Client.

Program Files\Microsoft SQL Server\90\SDK\Lib


You need to redistribute SQL Native Client with your application so that it installs on client computers. An installation package named SQLNCLI.msi is included on the SQL Server 2005 installation CD, in the Tools\Setup directory. The ReadmeSQL2005.htm file in the Tools directory of the installation CD discusses client- and server-side prerequisites and provides installation instructions.

See Microsoft SQL Server 2005 Books Online for information about SQL Native Client (OLE DB) and SQL Native Client (ODBC) programming.



Previous Page
Next Page


JavaScript Editor Ajax toolkit     Ajax tutorials 
R7