附录 A:数据和服务提供商Appendix A: Data and Service Providers

本节介绍三种类型的提供程序:数据提供程序、服务提供程序和服务组件。This section addresses three kinds of providers: data providers, service providers, and service components. 提供程序分为两类:提供数据的提供程序和提供服务的提供程序。Providers fall into two categories: those providing data and those providing services. 数据访问接口 拥有自己的数据,并以表格形式向应用程序公开该数据。A data provider owns its own data and exposes it in tabular form to your application. 服务提供程序 通过生成和使用数据并在 ADO 应用程序中扩充功能来封装服务。A service provider encapsulates a service by producing and consuming data, augmenting features in your ADO applications. 服务提供商还可以被进一步定义为 服务组件,该组件必须与其他服务提供商或组件一起工作。A service provider may also be further defined as a service component, which must work together with other service providers or components.

数据提供程序Data Providers

ADO 的功能强大且灵活,因为它可以连接到多个不同的数据访问接口中的任何一种,并且仍公开相同的编程模型,而与任何给定提供程序的特定功能无关。ADO is powerful and flexible because it can connect to any of several different data providers and still expose the same programming model, regardless of the specific features of any given provider.

但是,由于每个数据提供程序都是唯一的,因此,应用程序与 ADO 交互的方式将与数据访问接口略有不同。However, because each data provider is unique, how your application interacts with ADO will vary slightly by data provider. 这些差异通常分为以下三个类别之一:The differences usually fall into one of three categories:

下面列出了 Microsoft 当前提供的每个数据提供程序的详细信息。Details for each of the data providers currently available from Microsoft are listed as follows.

区域Area 主题Topic
ODBC 数据库ODBC databases Microsoft OLE DB Provider for ODBCMicrosoft OLE DB Provider for ODBC
Microsoft 索引服务Microsoft Indexing Service Microsoft OLE DB Provider for Microsoft Indexing ServiceMicrosoft OLE DB Provider for Microsoft Indexing Service
Active Directory 服务Active Directory Service Microsoft OLE DB Provider for Microsoft Active Directory 服务Microsoft OLE DB Provider for Microsoft Active Directory Service
Microsoft Jet 数据库Microsoft Jet databases 用于 Microsoft Jet 的 OLE DB 提供程序OLE DB Provider for Microsoft Jet
Microsoft SQL ServerMicrosoft SQL Server Microsoft OLE DB Provider for SQL ServerMicrosoft OLE DB Provider for SQL Server
Oracle 数据库Oracle databases Microsoft OLE DB Provider for OracleMicrosoft OLE DB Provider for Oracle
Internet 发布Internet Publishing 用于 Internet 发布的 Microsoft OLE DB 提供程序Microsoft OLE DB Provider for Internet Publishing
简单数据源Simple data sources Microsoft OLE DB 简单提供程序Microsoft OLE DB Simple Provider

Provider-Specific 动态属性Provider-Specific Dynamic Properties

连接命令记录集对象的属性集合包括特定于提供程序的动态属性。The Properties collections of the Connection, Command, and Recordset objects include dynamic properties specific to the provider. 这些属性提供了有关特定于提供程序的功能的信息,这些功能超出了 ADO 支持的内置属性。These properties provide information about functionality specific to the provider beyond the built-in properties that ADO supports.

建立连接并创建这些对象后,请使用对象的 Properties 集合上的 Refresh方法来获取特定于提供程序的属性。After establishing the connection and creating these objects, use the Refresh method on the Properties collection of the object to obtain the provider-specific properties. 有关这些动态属性的详细信息,请参阅提供程序文档和 OLE DB 程序员指南Refer to the provider documentation and the OLE DB Programmer's Guide for detailed information about these dynamic properties.

服务提供商Service Providers

若要使用服务提供程序,必须提供关键字。To use a service provider, you must supply a keyword. 还应注意与每个服务提供程序相关联的特定于提供程序的动态属性。You should also be aware of the provider-specific dynamic properties associated with each service provider. 为当前提供的每个服务提供商列出了特定于提供程序的详细信息:Provider-specific details are listed for each service provider that is currently available from Microsoft:

服务组件Service Components

OLE DB 服务组件的 游标服务 对数据提供程序的游标支持函数进行了补充。The Cursor Service for OLE DB service component supplements the cursor support functions of data providers. 它还需要关键字并且具有动态属性。It also requires a keyword and has dynamic properties.

有关 OLE DB 提供程序的详细信息,请参阅 Microsoft OLE DBFor more information about OLE DB Providers, see Microsoft OLE DB.

提供程序命令Provider Commands

对于此处列出的每个提供程序,如果你的应用程序允许用户输入 SQL 语句作为提供程序命令,则必须始终验证用户输入,并使用潜在的危险 SQL 语句(如 DROP TABLE t1 )作为用户输入的一部分来警惕可能的黑客攻击。For each provider listed here, if your applications allow users to enter SQL statements as the provider commands, you must always validate the user input and be vigilant of possible hacker attacks using potentially dangerous SQL statements, such as DROP TABLE t1, as part of the user input.

另请参阅See Also

命令对象 (ado) 连接对象 (ado) microsoft OLE DB 提供程序 用于 Internet 发布的 microsoft OLE DB 提供程序 Microsoft Active Directory 提供程序for microsoft OLE DB提供程序用于 microsoft索引服务microsoft OLE DB 提供程序 microsoft Oracle 的 Microsoft OLE DB 提供程序 provider for ODBC OLE DB SQL Server OLE DB () Command Object (ADO) Connection Object (ADO) Microsoft OLE DB Provider for Internet Publishing Microsoft OLE DB Provider for Microsoft Active Directory Service Microsoft OLE DB Provider for Microsoft Indexing Service Microsoft OLE DB Provider for ODBC Microsoft OLE DB Provider for Oracle Microsoft OLE DB Provider for SQL Server Microsoft OLE DB Provider for Microsoft Jet Properties Collection (ADO) Recordset Object (ADO) Refresh Method (RDS)