MDAC 2.5 SDK - OLE DB Providers
OSP Toolkit
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 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.
The following sections describe the main components shown in the preceding illustration and explain how these components work.
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:
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:
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:
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.