Using the RegisterProvider.reg File

The RegisterProvider.reg file is supplied with the OSP Toolkit to automate the process of registering a provider. Use this file only when fully registering a provider (that is, including a registration entry for the OSP Data Object).

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.

Use this topic as a guide to entering the correct information in the RegisterProvider.reg file. When you are finished completing the template, you should rename it and double-click the file to import those settings into the registry.

Running the registry file is necessary so that the OLE DB Simple Provider DLL recognizes the OSP Data Object. You must also register the OSP Data Object separately by using Regsvr32.exe, or Javareg if you coded the object in Microsoft? Visual J++?.

If you are coding in Microsoft Visual C++?, you can add the required registry entries by using DLLRegisterServer instead of running RegisterProvider.reg.

You need to supply the following values before running RegisterProvider.reg:

  • ProgID for OLE DB Provider. A value you provide to identify your OLE DB provider in the registry.

  • Name of OLE DB Provider. The name your provider will be listed under. It is also created by you.

    Note

    The name of the provider can be localized because the ProgID references the object rather than the name. The ProgID is not localized.

  • GUID for OLE DB Provider. This is a unique GUID that identifies the OLE DB provider you have created. You should create one using a GUID generator.

  • ProgID for OSP Data Object. You determine this value from the OSP Data Object you developed; see the section in each of the development tools for information about how this is determined. (For example, in Microsoft Visual Basic?, it will be the project name followed by the name of the data source object class or control name. The names are separated by a period.)

Following is a copy of the registration template, and following that, an illustration of a completed registration template showing a set of example values.

Template ========================================================>
REGEDIT4

[HKEY_CLASSES_ROOT\<INSERT: ProgID for OLE DB Provider>]
@="<INSERT: Name of OLE DB Provider>"

[HKEY_CLASSES_ROOT\<INSERT: ProgID for OLE DB Provider>\CLSID]
@="<INSERT: GUID for OLE DB Provider>"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for OLE DB Provider>]
@="<INSERT: ProgID of OLE DB Provider>"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for OLE DB
Provider>\InprocServer32]
@="<INSERT: Path to OLE DB Directory example -->
c:\\Program Files\\Common Files\\System\\OLE DB\\>MSDAOSP.DLL"
"ThreadingModel"="Both"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for
OLE DB Provider>\ProgID]
@="<INSERT: ProgId of OLE DB Provider>.1"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for
OLE DB Provider>\VersionIndependentProgID]
@="<INSERT: ProgId of OLE DB Provider>"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for
OLE DB Provider>\OLE DB Provider]
@="<INSERT: Name of OLE DB Provider>"

[HKEY_CLASSES_ROOT\CLSID\<INSERT: GUID for
OLE DB Provider>\OSP Data Object]
@="<INSERT: ProgID for OSP Data Object>"

==========================================>
Example Values
==========================================>
ProgID for OLE DB Provider = TestPWProv
Name of OLE DB Provider = Microsoft Test OLE DB Provider for OSP
GUID for OLE DB Provider = {6B94E051-E170-11d0-94EA-00C04FB66A50}
ProgId for OSP Data Object= MyOSPProject.OSPClass

==========================================>
Example
==========================================>
REGEDIT4

[HKEY_CLASSES_ROOT\TestPWProv]
@="Microsoft Test OLE DB Provider for OSP"

[HKEY_CLASSES_ROOT\TestPWProv\CLSID]
@="{6B94E051-E170-11d0-94EA-00C04FB66A50}"

[HKEY_CLASSES_ROOT\CLSID\
{6B94E051-E170-11d0-94EA-00C04FB66A50}]
@="TestPWProv"

[HKEY_CLASSES_ROOT\CLSID\
{6B94E051-E170-11d0-94EA-00C04FB66A50}\InprocServer32]
@="c:\\Program Files\\Common Files\\
System\\OLE DB\\MSDAOSP.DLL"
"ThreadingModel"="Both"

[HKEY_CLASSES_ROOT\CLSID\{6B94E051-E170-11d0-94EA-00C04FB66A50}\ProgID]
@="TestPWProv.1"

[HKEY_CLASSES_ROOT\CLSID\{6B94E051-E170-11d0-94EA-00C04FB66A50}
\VersionIndependentProgID]
@="TestPWProv"

[HKEY_CLASSES_ROOT\CLSID\{6B94E051-E170-11d0-94EA-00C04FB66A50}
\OLE DB Provider]
@="Microsoft Test OLE DB Provider for OSP"

[HKEY_CLASSES_ROOT\CLSID\{6B94E051-E170-11d0-94EA-00C04FB66A50}
\OSP Data Object]
@="MyOSPProject.OSPClass"