共用方式為


OLE DB Provider Templates Reference

The classes and interfaces for the OLE DB Provider Templates can be grouped into the following categories. The reference material also includes information about the macros for OLE DB Provider Templates.

The classes use the following naming convention: a class named with the pattern IWidgetImpl would provide an implementation of the interface IWidget.

Session Classes

  • IDBCreateSessionImpl
    Creates a new session from the data source object and returns the requested interface on the newly created session. Mandatory interface on data source objects.

  • ISessionPropertiesImpl
    Implements session properties by calling a static function defined by the property set map. The property set map should be specified in your session class. Mandatory interface on sessions.

Rowset Classes

CRowsetImpl

Provides a standard OLE DB rowset implementation without requiring multiple inheritance of many implementation interfaces. The only method for which you must provide implementation is Execute.

  • CSimpleRow
    Provides a default implementation for the row handle, which is used in the IRowsetImpl class. A row handle is logically a unique tag for a result row. IRowsetImpl creates a new CSimpleRow for every row requested in IRowsetImpl::GetNextRows.

  • IAccessorImpl
    OLE DB requires providers to implement an HACCESSOR, which is a tag to an array of DBBINDING structures. Provides HACCESSORs that are addresses of the BindType structures. Mandatory on rowsets and commands.

  • IColumnsInfoImpl
    Delegates to a static function defined by the provider column map. Mandatory interface on rowsets and commands.

  • IConvertTypeImpl
    Gives information on the availability of type conversions on a command or on a rowset. Mandatory on commands, rowsets, and index rowsets. Implements the IConvertType interface by delegating to the conversion object supplied by OLE DB.

  • IDBSchemaRowsetImpl
    Implements the IDBSchemaRowset interface and the templatized creator function CreateSchemaRowset.

  • IOpenRowsetImpl
    Opens and returns a rowset that includes all rows from a single base table or index. Mandatory interface for a session object.

  • IRowsetChangeImpl
    Implements the OLE DB IRowsetChange interface, which enables updating of the values of columns in existing rows, deleting rows, and inserting new rows.

  • IRowsetCreatorImpl
    This class inherits from IObjectWithSite and overrides IObjectWithSite::SetSite. IRowsetCreatorImpl performs the same functions as IObjectWithSite but also enables the OLE DB properties DBPROPCANSCROLLBACKWARDS and DBPROPCANFETCHBACKWARDS.

  • IRowsetIdentityImpl
    Implements the IRowsetIdentity interface, which allows you to compare whether two rows of data are identical or not.

  • IRowsetImpl
    Provides an implementation of the IRowset interface, which is the base rowset interface.

  • IRowsetInfoImpl
    Implements the rowset properties by using the property set map defined in your command class. Mandatory interface on rowsets.

  • IRowsetLocateImpl
    Implements the OLE DB IRowsetLocate interface, which fetches arbitrary rows from a rowset. To support OLE DB bookmarks in a rowset, make the rowset inherit from this class.

  • IRowsetNotifyCP
    Implements broadcast functions to advise listeners on the connection point IID_IRowsetNotify of changes to the contents of the rowset. Consumers that handle notifications implement IRowsetNotify and register it on that connection point.

  • IRowsetUpdateImpl
    Implements the OLE DB IRowsetUpdate interface, which enables consumers to delay the transmission of changes made with IRowsetChange to the data source and undo changes before transmission.

Command Classes

  • ICommandImpl
    Provides an implementation of the ICommand interface. This interface is not visible, but is handled by ICommandTextImpl. A mandatory interface on the command object.

  • ICommandPropertiesImpl
    This implementation of the ICommandProperties interface is provided by a static function defined by the BEGIN_PROPSET_MAP macro. Mandatory on commands.

  • ICommandTextImpl
    Sets, stores, and returns the command text. Mandatory on commands.

  • IDBCreateCommandImpl
    Creates a new command from the session object and returns the requested interface on the newly created command. Optional interface on session objects.

Other command classes are IColumnsInfoImpl and IAccessorImpl, described in the Rowset Classes section above.

Data Source Classes

  • IDBInitializeImpl
    Creates and deletes the connection with the consumer. Mandatory interface on data source objects and optional interface on enumerators.

  • IDBPropertiesImpl
    IDBProperties is a mandatory interface for data source objects and an optional interface for enumerators. However, if an enumerator exposes IDBInitialize, it must expose IDBProperties (properties on the data source).

  • IGetDataSourceImpl
    Obtains an interface pointer to the data source object. Mandatory interface on the session.

Other Classes

  • CUtlProps
    Implements properties for a variety of OLE DB property interfaces (for example, IDBProperties, ISessionProperties, and IRowsetInfo).

IErrorRecordsImpl

Implements the OLE DB IErrorRecords interface, adding records to and retrieving records from a data member.

See Also

Concepts

OLE DB Consumer Templates Reference

Other Resources

OLE DB Templates