SQL Server Native Client 编程SQL Server Native Client Programming

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics 是并行数据仓库Parallel Data Warehouseyes并行数据仓库Parallel Data Warehouse

SQL ServerSQL Server Native Client 是在 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中引入的用于 OLE DB 和 ODBC 的独立数据访问应用程序编程接口 (API)。Native Client is a stand-alone data access application programming interface (API), used for both OLE DB and ODBC, that was introduced in SQL Server 2005 (9.x)SQL Server 2005 (9.x). SQL ServerSQL Server Native Client 将 SQL OLE DB 访问接口和 SQL ODBC 驱动程序组合成一个本机动态链接库 (DLL)。Native Client combines the SQL OLE DB provider and the SQL ODBC driver into one native dynamic-link library (DLL). 除 Windows 数据访问组件(Windows DAC,以前为 Microsoft 数据访问组件或 MDAC)提供的功能之外,它还提供新的功能。It also provides new functionality above and beyond that supplied by the Windows Data Access Components (Windows DAC, formerly Microsoft Data Access Components, or MDAC). SQL ServerSQL Server Native Client 可用于创建新应用程序或增强现有应用程序,使这些应用程序能够利用在 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中引入的功能,例如多个活动结果集 (MARS)、用户定义数据类型 (UDT)、查询通知、快照隔离和 XML 数据类型支持。Native Client can be used to create new applications or enhance existing applications that need to take advantage of features introduced in SQL Server 2005 (9.x)SQL Server 2005 (9.x), such as multiple active result sets (MARS), user-defined data types (UDT), query notifications, snapshot isolation, and XML data type support.

备注

有关 SQL ServerSQL Server Native client 和 WINDOWS dac 之间的差异列表,以及有关将 WINDOWS DAC 应用程序更新到 Native Client 之前要考虑的问题的信息 SQL ServerSQL Server ,请参阅将 应用程序更新为从 MDAC SQL Server Native ClientFor a list of the differences between SQL ServerSQL Server Native Client and Windows DAC, plus information about issues to consider before updating a Windows DAC application to SQL ServerSQL Server Native Client, see Updating an Application to SQL Server Native Client from MDAC.

SQL ServerSQL Server Native Client ODBC 驱动程序始终与 Windows DAC 提供的 ODBC 驱动程序管理器一起使用。The SQL ServerSQL Server Native Client ODBC driver is always used in conjunction with the ODBC Driver Manager supplied with Windows DAC. SQL ServerSQL Server Native Client OLE DB 访问接口可与 Windows DAC 提供的 OLE DB 核心服务一起使用,但这不是必要条件;是否选择使用核心服务取决于单个应用程序的要求(例如,是否必需连接池)。The SQL ServerSQL Server Native Client OLE DB provider can be used in conjunction with OLE DB Core Services supplied with Windows DAC, but this is not a requirement; the choice to use Core Services or not depends on the requirements of the individual application (for example, if connection pooling is required).

(ADO) 的 ActiveX 数据对象可以使用 SQL ServerSQL Server Native Client OLE DB 提供程序,但建议结合使用 ADO 和 DataTypeCompatibility 连接字符串关键字 (或其对应的 数据源 属性) 。ActiveX Data Object (ADO) applications may use the SQL ServerSQL Server Native Client OLE DB provider, but it is recommended to use ADO in conjunction with the DataTypeCompatibility connection string keyword (or its corresponding DataSource property). 使用 SQL ServerSQL Server Native Client OLE DB 访问接口时,ADO 应用程序可以通过连接字符串关键字、OLE DB 属性或 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 利用在 SQL ServerSQL Server 中引入的通过 Transact-SQLTransact-SQL Native Client 提供的那些新功能。When using the SQL ServerSQL Server Native Client OLE DB provider, ADO applications may exploit those new features introduced in SQL Server 2005 (9.x)SQL Server 2005 (9.x) that are available via the SQL ServerSQL Server Native Client via connection string keywords or OLE DB properties or Transact-SQLTransact-SQL. 有关使用这些功能和 ADO 的详细信息,请参阅 使用 ado 和 SQL Server Native ClientFor more information about the use of these features with ADO, see Using ADO with SQL Server Native Client.

SQL ServerSQL Server Native Client 旨在提供一种使用 OLE DB 或 ODBC 获取对 SQL Server 的本机数据访问的简化方法。Native Client was designed to provide a simplified method of gaining native data access to SQL Server using either OLE DB or ODBC. 简化之处在于它将 OLE DB 和 ODBC 技术组合到一个库中,并且它提供一种创新和开发新的数据访问功能而不更改当前 Windows DAC 组件(现在是 Microsoft Windows 平台的一部分)的方法。It is simplified in that it combines OLE DB and ODBC technologies into one library, and it provides a way to innovate and evolve new data access features without changing the current Windows DAC components, which are now part of the Microsoft Windows platform.

SQL ServerSQL Server Native Client 使用 WINDOWS dac 中的组件时,它不会显式依赖于特定版本的 WINDOWS dac。While SQL ServerSQL Server Native Client uses components in Windows DAC, it is not explicitly dependent on a particular version of Windows DAC. 可以将 SQL ServerSQL Server Native Client 与随 SQL ServerSQL Server Native Client 支持的任一操作系统安装的 Windows DAC 版本一起使用。You can use SQL ServerSQL Server Native Client with the version of Windows DAC that is installed with any operating system supported by SQL ServerSQL Server Native Client.

本节内容In This Section

SQL Server Native ClientSQL Server Native Client
列出重大的 SQL ServerSQL Server Native Client 新功能。Lists the significant new SQL ServerSQL Server Native Client features.

何时使用 SQL Server Native ClientWhen to Use SQL Server Native Client
讨论 SQL ServerSQL Server Native Client 如何适应 Microsoft 数据访问技术,它如何与 WINDOWS DAC 和 ADO.NET 进行比较,并提供用于决定要使用的数据访问技术的指针。Discusses how SQL ServerSQL Server Native Client fits in with Microsoft data access technologies, how it compares to Windows DAC and ADO.NET, and provides pointers for deciding which data access technology to use.

SQL Server Native Client 功能SQL Server Native Client Features
介绍 SQL ServerSQL Server Native Client 支持的功能。Describes the features supported by SQL ServerSQL Server Native Client.

使用 SQL Server Native Client 生成应用程序Building Applications with SQL Server Native Client
提供 SQL ServerSQL Server Native Client 开发概述,包括它与 Windows DAC 的不同之处、它使用的组件,以及如何将 ADO 与它一起使用。Provides an overview of SQL ServerSQL Server Native Client development, including how it differs from Windows DAC, the components that it uses, and how ADO can be used with it.

本节还讨论 SQL ServerSQL Server Native Client 的安装和部署,包括如何再分发 SQL ServerSQL Server Native Client 库。This section also discusses SQL ServerSQL Server Native Client installation and deployment, including how to redistribute the SQL ServerSQL Server Native Client library.

SQL Server Native Client 的系统要求System Requirements for SQL Server Native Client
讨论使用 SQL ServerSQL Server Native Client 所需的系统资源。Discusses the system resources needed to use SQL ServerSQL Server Native Client.

SQL Server Native Client (OLE DB)SQL Server Native Client (OLE DB)
提供有关使用 SQL ServerSQL Server Native Client OLE DB 访问接口的信息。Provides information about using the SQL ServerSQL Server Native Client OLE DB provider.

SQL Server Native Client (ODBC)SQL Server Native Client (ODBC)
提供有关使用 SQL ServerSQL Server Native Client ODBC 驱动程序的信息。Provides information about using the SQL ServerSQL Server Native Client ODBC driver.

查找更多 SQL Server Native Client 信息Finding More SQL Server Native Client Information
提供有关 SQL ServerSQL Server Native Client 的其他资源,包括指向外部资源和获取进一步帮助的链接。Provides additional resources about SQL ServerSQL Server Native Client, including links to external resources and getting further assistance.

SQL Server Native Client 错误SQL Server Native Client Errors
包含有关与 SQL ServerSQL Server Native Client 关联的运行时错误的主题。Contains topics about runtime errors associated with SQL ServerSQL Server Native Client.

另请参阅See Also

从 SQL Server 2005 Native Client 更新应用程序 Updating an Application from SQL Server 2005 Native Client
ODBC 操作指南主题 ODBC How-to Topics
OLE DB 操作指南主题OLE DB How-to Topics