MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 20: OLE DB Core Components
Flow of Operations
Determining Provider Support for a Customized User Interface
- When a provider is chosen via the Providers tab, the Data Link core component cocreates that provider's data source object.
- 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.
- 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:
- Call the provider's IPropertyPage::IsPageDirty method to determine whether there have been changes.
- If dirty, call IPersistPropertyBag::Save to have those changes committed to the temporary store.
- Call IPropertyPage::Deactivate on the current page.
- 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.