Toolkit Components

When you build an OLE DB provider with Microsoft's OLE DB Simple Provider Toolkit, you are actually assembling a provider from several Microsoft component technologies.

Providers built with the OSP Toolkit consist of an OLE DB Simple Provider DLL (Msdaosp.dll) that interoperates with one or more implementations of the Microsoft® Internet Explorer OSP API, found in the OSP Language Reference. The OSP Toolkit supplies interfaces for basic provider capabilities over simple data and expands the simple data provider functionality, adding comprehensive support for core OLE DB interfaces and OLE DB properties, with features such as bookmarks and unique row handles (for improved data identification) and with limited data conversion capabilities.

The following illustration shows, at a high level, the architecture of an OLE DB provider written with the OSP Toolkit.

Note Note

OSP implements its own data source object through IDataSource or msDataSourceObject. The OSP implementation of the data source object is different from the OLE DB implementation. In this document, the OLE DB object is called a "data source object," whereas the OSP implementation is referred to as the "OSP data source object." In the following illustration, msDataSourceObject is used to create the OSP data source object, which appears above Msdaosp.dll.

high-level provider architecture based on OSP

The following sections describe the main components shown in the preceding illustration and explain how these components work.

Important note Important

This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, write a fully functional OLE DB provider using the native OLE DB interfaces.

These can be any OLE DB–compliant applications or controls on a computer on which the provider is registered. If you are using ADO Recordset objects as a consumer, you code the provider identification information in the connection string and receive the data in the form of ADO Recordset objects.

The OLE DB Simple Provider DLL (Msdaosp.dll) acts as the go-between for the OSP Data Object and the consuming application or control. The DLL consists of code that understands OSP interface calls and does the following:

  • Exposes the OLE DB data source, session, and rowset objects to consumers such as ADO, data-binding controls, or OLE DB–compliant applications.

  • Uses either the msDataSourceObject function or the IDataSource::getDataMember function to select the correct OSP objects.

  • Consumes OSP interfaces from a data source and exposes the data as an OLE DB rowset object.

  • Makes OLE DB notifications available. This information can be passed on to consuming objects, informing them whether data currently being manipulated has changed.

The OLE DB Simple Provider DLL assumes that OSP is correctly implemented (according to the OSP specification) and does no internal checking of OSP parameters or return codes.

To accommodate different programming language environments as well as multiple data sources and their OSP implementations, and to coordinate different types of notification, the simple data provider architecture includes an abstraction called the OSP Data Object. This object needs to be coded and registered before it is instantiated and used with the OLE DB Simple Provider DLL.

An OSP Data Object implements one or more instances of OSP, with each instance giving access to a particular source of data. The OSP Data Object includes the following methods that allow the OLE DB Simple Provider DLL to request the desired OSP implementation and, therefore, the desired data source:

  • If you are writing the provider in Microsoft® Visual C++®, you will use the IDataSource interface and its getDataMember method to request an OSP.

  • If you are writing the provider in Microsoft Visual Basic® or Microsoft Visual J++®, you will use the msDataSourceObject method along with the appropriate IDispatch methods to request an OSP.

In the above implementations, which OSP to request is based on the DataMember string that is passed in to the OSP Data Object. The format and syntax of that string is implementation-defined and must be specified by each OSP developer and to users of the OSP data source.

To expose a provider's full OLE DB functionality, the OSP Data Object needs to reference the OLE DB Simple Provider DLL (Msdaosp.dll). The developer can accomplish this in one of the following ways:

  • Complete the RegisterProvider.reg file supplied with the Toolkit.

  • Supply an established personal registration code for the OSP Data Object.

After the above step has been completed, the developer must register the OSP Data Object by using Regsvr32.exe (in Visual Basic and Visual C++ implementations) or Javareg (in Visual J++).

The OSP Data Object also sends OSP notifications to Msdaosp.dll, and data source notifications to Msdaosp.dll or external data consumers or controls (that is, applications outside the provider framework but able to access the same data sources). Where the data source notifications are sent depends on which of the objects (Msdaosp.dll or an external data consumer) obtained the instance of the OSP data source object.