Flow of Operations

OLE DB Programmer's Reference

Determining Provider Support for a Customized User Interface

  1. When a provider is chosen via the Providers tab, the Data Link core component cocreates that provider's data source object.
  2. The Data Link core component calls IUnknown::QueryInterface for IServiceProvider. If this fails, the core component assumes that the provider does not support extensions and will use the default property pages.
  3. If the call to QueryInterface succeeds, the Data Link core component calls IServiceProvider::QueryService with OLEDB_SVC_DSLPropertyPages and IID_ISpecifyPropertyPages to retrieve the object that provides property pages for the Data Link core component. If this fails, the Data Link core component will assume that the provider does not support extensions and will use the default property pages.

Loading Pages

  • The Data Link core component calls ISpecifyPropertyPages::GetPages, receiving an array of page CLSIDs. The provider can specify only two pages here: one that replaces Connection, and one that replaces Advanced. The tabs will be replaced in the order that the elements exist within the CLSID array.
  • The Data Link core component walks the array, cocreating each of the pages. On each page, it calls IUnknown::QueryInterface for IPropertyPage and calls IPropertyPage::SetPageSite with the Data Link core component IPropertyPageSite implementation.

Data Link Core Component Actions on Tab Change

There are two possible code paths within the current the Data Link core component implementation: one that is used for the Data Link core component internal pages, and one that is used for the providers pages.

  • If the current page is a Data Link core component internal page, it will commit changes to the per-provider property store.
  • If the current page is a non-Data Link core component owned page, it will do the following:
    1. Call the provider's IPropertyPage::IsPageDirty method to determine whether there have been changes.
    2. If dirty, call IPersistPropertyBag::Save to have those changes committed to the temporary store.
    3. Call IPropertyPage::Deactivate on the current page.
    4. Call IPropertyPage::Activate on the new page, followed by IPersistPropertyBag::Load.

Provider Actions on Page Change

  • The provider page losing focus will receive an IPropertyPage::IsPageDirty call; if there are deltas on the page, it will return True.
  • If dirty, the provider will receive an IPersistPropertyBag::Save. In that code, it will write the changes from its controls to the specified IPropertyBag interface. It should write only those values that are different from the defaults. This enables the Data Source Locator to build a connection string that contains only the nondefault properties.
  • The property page will receive an IPropertyPage::Deactivate call, during which it should deactivate the window.
  • The provider page getting focus will receive an IPropertyPage::Activate method call as well as a call to IPersistPropertyBag::Load, from which it can populate its controls.

Unloading Pages

  • The Data Link core component calls SetPageSite with a null pointer when unloading the provider's user interface.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net