Compartir a través de


Registration Without a .reg File

You can register a provider without a special entry for the OSP Data Object. In this case, you do not use the RegisterProvider.reg template file supplied with the OLE DB Simple Provider Toolkit.

If you choose this method of registration, you need consumer code to instantiate the provider. The provider must be instantiated with CoCreateInstance, using the GUID of the Msdaosp.dll. At run time, the ProgID of the OSP Data Object must be handed off to direct the DLL to the correct OSP object through the DBPROP_INIT_DATASOURCE property.

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.

To register a provider without using the RegisterProvider.reg file

  1. Register the Simple Provider DLL (Msdaosp.dll) with Regsvr32.exe.

  2. Register the OSP object. (For Visual C++ and Visual J++ users only ? Visual Basic users will omit this step because that environment automatically registers the DLL.)

    • If you are using Visual C++ and have compiled and linked your OSP object (the DLL containing the OSP implementations and data source object), register it using Regsvr32.exe.

    • If you are using Visual J++, register the Java class code for the OSP object using Javareg.

Windows Registry Entries

The following entries are written to the registry after performing steps 1 and 2 in the previous section.

The first group of registry entries, shown below, consists of entries listed under the CLSID subkey that are generated by running Regsvr32.exe on Msdaosp.dll (step 1).

        HKEY_CLASSES_ROOT
   CLSID
      {CLSID of MSDAOSP.DLL}
         InprocServer32
            (Default) = "C:\PROGRAMFILES\COMMON FILES\
                        SYSTEM\OLE DB\MSDAOSP.DLL"
         OLE DB Provider
            (Default) = " Microsoft OLE DB Simple Provider"
         ProgID
            (Default) = "MSDAOSP.1"
         VersionIndependentProgID
            (Default) = "MSDAOSP"

The second group of registry entries, shown below, consists of entries listed under the CLSID subkey that are generated by running Regsvr32.exe on the provider DLL (step 2).

        HKEY_CLASSES_ROOT
   CLSID
      {CLSID of OSP Data Object }
         InprocServer32
            (Default) = "Path of OSP Data Object DLL"
            Threading Model = "Both"
         ProgID
            (Default) = "ProgID specified for the OSP Data Object"
         VersionIndependentProgID
            (Default) = "Version independent ProgID for this provider"