INFO: Wizards Use CDataSource::OpenWithServiceComponents()

ID: Q190969


The information in this article applies to:


SUMMARY

CDatasource::OpenWithServiceComponents() was added to the OLE DB Templates late in the development stage and did not make it into the online documentation (it is documented in the Visual C++ 6.0 Readme).

OpenWithServiceComponents() was added to support the use of the OLE DB Service Components.

The ATL OLE DB Consumer Wizard may output code that uses CDatasource::OpenWithServiceComponents().

The MFC AppWizard, when using OLE DB support, always outputs code that uses CDatasource::OpenWithServiceComponents().


MORE INFORMATION

The OLE DB Service Components provide guaranteed functionality to OLE DB consumers above the minimum level required by OLE DB providers. The OLE DB 2.0 service components support:

When using the MFC AppWizard with OLE DB support, a function C<ProjectName>Set::Open() is created. Within this function, a call to CDatasource::OpenWithServiceComponents() is made.

When using the ATL OLE DB Consumer Wizard, a function C<TableName>::OpenDataSource() is created. The following logic is used by the Consumer Wizard to determine whether CDataSource::Open() or CDataSource::OpenWithServiceComponents() is called from C<TableName>::OpenDataSource();.

  1. The Wizard checks the provider to see if it supports IRowsetChange. If supported, the wizard generates code to call CDataSource::Open(). The OLE DB Service components are not required to obtain update functionality.


  2. If the provider doesn't support IRowsetChange but does support SQL (the Wizard checks the DBPROP_SQLSUPPORT property of the DBPROPSET_DATASOURCEINFO property set), then the wizard generates code to call CDataSource::OpenWithServiceComponents(). The Service Components are required to obtain update functionality through SQL. The Microsoft Provider for Oracle is an example of such a provider.


  3. If the provider doesn't support IRowsetChange and doesn't support SQL, then the wizard will not try to set any update properties. For 2 and 3, above, the wizard also generates a comment to explain what is happening.



REFERENCES

Visual C++ 6.0 Readme

OLE DB 2.0 Readme

The OLE DB 2.0 readme contains the documentation for the OLE DB Service Components.

Additional query words: kbWizard kbATL kbDatabase kbOLEDB kbvc600


Keywords          : kbwizard kbATL kbDatabase kbOLEDB 
Version           : WINNT:6.0
Platform          : winnt 
Issue type        : kbinfo 

Last Reviewed: August 3, 1999