Microsoft OLE DB Driver for SQL ServerMicrosoft OLE DB Driver for SQL Server

適用於: 是SQL Server 是Azure SQL Database 是Azure Synapse Analytics (SQL DW) 是平行處理資料倉儲 APPLIES TO: yesSQL Server yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) yesParallel Data Warehouse

下載OLE DB 驅動程式下載DownloadDownload OLE DB Driver

OLE DB Driver for SQL Server 是用於 OLE DB 的獨立資料存取應用程式開發介面 (API) (已在 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中導入)。The OLE DB Driver for SQL Server is a stand-alone data access application programming interface (API), used for OLE DB, that was introduced in SQL Server 2005 (9.x)SQL Server 2005 (9.x). OLE DB Driver for SQL Server 會在一個動態連結程式庫 (DLL) 中提供 SQL OLE DB 驅動程式。OLE DB Driver for SQL Server delivers the SQL OLE DB driver in one dynamic-link library (DLL). 此介面也提供遠超過 Windows Data Access Components (Windows DAC,之前稱為 Microsoft Data Access Components,或稱 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). OLE DB Driver for SQL Server 可用於建立新的應用程式,或者加強需要利用 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中所導入功能 (例如,Multiple Active Result Set (MARS)、使用者定義資料型別 (UDT)、查詢通知、快照集隔離和 XML 資料型別支援) 的現有應用程式。The OLE DB Driver for SQL Server 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.

注意

如需 OLE DB Driver for SQL Server 和 Windows DAC 之間的差異清單,以及在將 Windows DAC 應用程式更新為 OLE DB Driver for SQL Server 前要考慮之問題的相關資訊,請參閱將應用程式從 MDAC 更新為 OLE DB Driver for SQL ServerFor a list of the differences between OLE DB Driver for SQL Server and Windows DAC, plus information about issues to consider before updating a Windows DAC application to OLE DB Driver for SQL Server, see Updating an Application to OLE DB Driver for SQL Server from MDAC.

重要

先前的 Microsoft OLE DB Provider for SQL Server (SQLOLEDB) 和 SQL Server Native Client OLE DB 提供者 (SQLNCLI) 仍會被取代,因而不建議將它們用於新的程式開發工作。The previous Microsoft OLE DB Provider for SQL Server (SQLOLEDB) and SQL Server Native Client OLE DB provider (SQLNCLI) remains deprecated and it is not recommended to use either for new development work.

OLE DB Driver for SQL Server 可以配合 Windows DAC 所提供的 OLE DB Core Services 使用,但這並非必要條件;是否使用 Core Services 是依個別應用程式的需求而定 (例如,是否需要連接共用)。The OLE DB Driver for SQL Server 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).

ActiveX Data Object (ADO) 應用程式可能會使用 OLE DB Driver for SQL Server,但建議將 ADO 搭配 DataTypeCompatibility 連接字串關鍵字 (或其對應的 DataSource 屬性) 使用。ActiveX Data Object (ADO) applications may use the OLE DB Driver for SQL Server, but it is recommended to use ADO in conjunction with the DataTypeCompatibility connection string keyword (or its corresponding DataSource property). 使用 OLE DB Driver for SQL Server 時,ADO 應用程式可能會利用 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 中所導入的新功能,這些新功能可透過連接字串關鍵字或 OLE DB 屬性或 Transact-SQLTransact-SQL,透過 OLE DB Driver for SQL Serve 使用。When using the OLE DB Driver for SQL Server, ADO applications may exploit those new features introduced in SQL Server 2005 (9.x)SQL Server 2005 (9.x) that are available via the OLE DB Driver for SQL Server via connection string keywords or OLE DB properties or Transact-SQLTransact-SQL. 如需搭配 ADO 使用這些功能的詳細資訊,請參閱搭配使用 ADO 與 OLE DB Driver for SQL ServerFor more information about the use of these features with ADO, see Using ADO with OLE DB Driver for SQL Server.

OLE DB Driver for SQL Server 的設計目的是提供簡化的方法,讓您使用 OLE DB 取得 SQL Server 的原生資料存取權。OLE DB Driver for SQL Server was designed to provide a simplified method of gaining native data access to SQL Server using OLE DB. 它提供一種方式來改革及發展新的資料存取功能,而不需變更目前的 Windows DAC 元件 (這些元件現在為 Microsoft Windows 平台的一部分)。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.

雖然 OLE DB Driver for SQL Server 會使用 Windows DAC 中的元件,但它並非明確相依於特定的 Windows DAC 版本。While OLE DB Driver for SQL Server uses components in Windows DAC, it is not explicitly dependant on a particular version of Windows DAC. 您可以使用 OLE DB Driver for SQL Server 搭配 OLE DB Driver for SQL Server 所支援之任何作業系統安裝的 Windows DAC 版本。You can use OLE DB Driver for SQL Server with the version of Windows DAC that is installed with any operating system supported by OLE DB Driver for SQL Server.

不同世代的 OLE DB 驅動程式Different generations of OLE DB Drivers

有三個不同世代的 Microsoft OLE DB Provider for SQL Server。There are three distinct generations of Microsoft OLE DB providers for SQL Server.

1.Microsoft OLE DB Provider for SQL Server (SQLOLEDB)1. Microsoft OLE DB Provider for SQL Server (SQLOLEDB)

Microsoft OLE DB Provider for SQL Server (SQLOLEDB) 仍隨附於 Windows Data Access Component (英文)。The Microsoft OLE DB Provider for SQL Server (SQLOLEDB) still ships as part of Windows Data Access Components. 它已不再受到維護,因此,不建議使用此驅動程式來進行新開發。It is not maintained anymore and it is not recommended to use this driver for new development.

2.SQL Server Native Client (SNAC)2. SQL Server Native Client (SNAC)

SQL Server 2005 (9.x)SQL Server 2005 (9.x) 開始,SQL Server Native Client (SNAC) 包含 OLE DB 提供者介面 (SQLNCLI),其為透過 SQL Server 2012 (11.x)SQL Server 2012 (11.x) 隨附於 SQL Server 2005 (9.x)SQL Server 2005 (9.x) 的 OLE DB 提供者。Starting in SQL Server 2005 (9.x)SQL Server 2005 (9.x), the SQL Server Native Client (SNAC) includes an OLE DB provider interface (SQLNCLI) and is the OLE DB provider that shipped with SQL Server 2005 (9.x)SQL Server 2005 (9.x) through SQL Server 2012 (11.x)SQL Server 2012 (11.x).

已在 2011 年宣布取代 (英文) 它,因此,不建議使用此驅動程式來進行新開發。It was announced as deprecated in 2011 and it is not recommended to use this driver for new development. 如需 SNAC 生命週期與可用下載的詳細資訊,請參閱 SNAC 生命週期的說明 (英文)。For more information about the SNAC lifecycle and available downloads, refer to SNAC lifecycle explained.

3.Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)3. Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)

OLE DB 已取消取代 (英文) 並於 2018 年發行。OLE DB was undeprecated and released in 2018.

新的 OLE DB 提供者稱為 Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)。The new OLE DB provider is called the Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL). 從現在開始,新的提供者將使用最新的伺服器功能來更新。The new provider will be updated with the most recent server features going forward.

注意

若要在現有的應用程式中使用新的 Microsoft OLE DB Driver for SQL Server,您應該規劃將連接字串從 SQLOLEDB 或 SQLNCLI 轉換為 MSOLEDBSQL。To use the new Microsoft OLE DB Driver for SQL Server in existing applications, you should plan to convert your connection strings from SQLOLEDB or SQLNCLI, to MSOLEDBSQL.

本節內容In this section

使用 OLE DB Driver for SQL Server 的時機When to use OLE DB Driver for SQL Server
討論 OLE DB Driver for SQL Server 在 Microsoft 資料存取技術中扮演什麼角色、它與 Windows DAC 和 ADO.NET 的比較,並提供指標以決定要使用什麼資料存取技術。Discusses how OLE DB Driver for SQL Server 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.

OLE DB Driver for SQL Server 功能OLE DB Driver for SQL Server features
說明 OLE DB Driver for SQL Server 所支援的功能。Describes the features supported by OLE DB Driver for SQL Server.

使用 OLE DB Driver for SQL Server 建置應用程式Building applications with OLE DB Driver for SQL Server
提供 OLE DB Driver for SQL Server 開發的概觀,包括與 Windows DAC 的差異、所使用的元件,以及如何搭配 ADO 使用。Provides an overview of OLE DB Driver for SQL Server development, including how it differs from Windows DAC, the components that it uses, and how ADO can be used with it.

本節也會討論 OLE DB Driver for SQL Server 安裝和部署,包括如何轉散發 OLE DB Driver for SQL Server 程式庫。This section also discusses OLE DB Driver for SQL Server installation and deployment, including how to redistribute the OLE DB Driver for SQL Server library.

OLE DB Driver for SQL Server 的系統需求System requirements for OLE DB Driver for SQL Server
討論使用 OLE DB Driver for SQL Server 所需的系統資源。Discusses the system resources needed to use OLE DB Driver for SQL Server.

OLE DB Driver for SQL Server 程式設計OLE DB Driver for SQL Server programming
提供使用 OLE DB Driver for SQL Server 的相關資訊。Provides information about using the OLE DB Driver for SQL Server.

尋找更多 OLE DB Driver for SQL Server 資訊Finding more OLE DB Driver for SQL Server information
提供 OLE DB Driver for SQL Server 的其他相關資源,包括外部資源及取得進一步協助的連結。Provides additional resources about OLE DB Driver for SQL Server, including links to external resources and getting further assistance.

另請參閱See also

從 SQL Server 2005 Native Client 更新應用程式 Updating an application from SQL Server 2005 Native Client
OLE DB 使用說明主題OLE DB how-to topics