OLE DB is an open specification designed to build on the success of ODBC by providing an open standard for accessing all kinds of data throughout the enterprise. OLE DB is a core technology supporting universal data access. Whereas ODBC was created to access relational databases, OLE DB is designed for the relational and nonrelational information sources, such as mail stores, text and graphical data for the Web, directory services, and IMS and VSAM data stored in the mainframe. OLE DB components consist of data providers, which expose their data; data consumers, which use data; and service components, which process and transport data (for example, query processors and cursor engines). These components are designed to integrate smoothly to help OLE DB component vendors quickly bring high-quality OLE DB components to market. OLE DB includes a bridge to ODBC to enable continued support for the broad range of ODBC relational database drivers available today.
There are two types of OLE DB applications: consumers and providers. A consumer can be any application that uses or consumes OLE DB interfaces. For example, a Microsoft Visual C++ application that uses OLE DB interfaces to connect to database server is an OLE DB consumer. The ADO object model that uses OLE DB interfaces is an OLE DB consumer. Any application that uses the ADO object model uses OLE DB interfaces indirectly through the ADO objects.
An OLE DB provider implements OLE DB interfaces; therefore, an OLE DB provider allows consumers to access data in a uniform way through a known set of documented interfaces. In a sense, an OLE DB provider is similar to an ODBC driver that provides a uniform mechanism for accessing relational data. OLE DB providers not only provide a mechanism for relational data but also for nonrelational types of data. Furthermore, OLE DB providers are built on top of OLE Component Object Model (COM) interfaces that allow more flexibility; where a ODBC driver builds on top of a C API specification.
Microsoft OLE DB SDK version 1.1 shipped two OLE DB providers: the ODBC Provider and sample text provider. The sample text provider serves as an example that demonstrates the implementation detail of an OLE DB provider. The ODBC Provider is an OLE DB provider for ODBC drivers. This provider provides mechanism for consumers to use the existing ODBC drivers without having to rush to implement new OLE DB providers to replace existing ODBC drivers. For more information about OLE DB and OLE DB providers, see the OLE DB area at http://www.microsoft.com/data.
The ODBC Provider maps OLE DB interfaces to ODBC APIs. With the ODBC Provider, OLE DB consumers can connect to a database server through the existing ODBC drivers. A consumer calls an OLE DB interface on the ODBC Provider. The ODBC Provider invokes corresponding ODBC APIs and sends the requests to an ODBC driver.
Because the ODBC Provider allows OLE DB consumers to use existing ODBC drivers, there may be some performance concern about the additional layer of the ODBC Provider on top of the existing ODBC driver manager. The design goal of the ODBC Provider is to implement all the functionality of the ODBC driver manager; therefore, the ODBC driver manager is not needed. However, with the ODBC Provider version 1.1, the ODBC driver manager is still required to support connection pooling with ODBC applications.