addOLEDBSimpleProviderListener

Registers the named event handler interface to receive notifications of changes to data.

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.

Syntax

HRESULT addOLEDBSimpleProviderListener (
   OLEDBSimpleProviderListener    *pospIListener);

Parameters

  • pospIListener
    [in] The event handler interface to be registered.

Return Codes

  • S_OK
    The method succeeded.

  • E_FAIL
    A provider-specific error occurred.

Comments

If an event handler was previously specified, OLEDBSimpleProvider::addOLEDBSimpleProviderListener releases that event handler prior to registering pospIListener.

The simple provider must implement this method to maintain a list of simple provider listeners. If not implemented, OLE DB methods called by consumers may fail because the mapping layer is unable to notify listeners of events. For example, IOpenRowset::OpenRowset would return DB_E_OBJECTOPEN if OLEDBSimpleProvider::addOLEDBSimpleProviderListener is not implemented.

For multiple OLE DB rowsets over the same data set, your implementation must support multiple listeners; otherwise, only one "active" rowset will be allowed.