|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
OLE DB Consumer Templates
The OLE DB Consumer Templates contain the following classes. The reference material also includes topics on the macros for OLE DB Consumer Templates.
- Manages the connection with the data source. This is a useful class for creating clients because it encapsulates necessary objects (data source and session) and some of the work you need to do when connecting to a data source.
- Corresponds to an OLE DB data source object, representing a connection through a provider to a data source. One or more database sessions, each represented by a CSession object, can take place on a single connection.
- Corresponds to an OLE DB enumerator object, which retrieves rowset information about available data sources.
- Used by CEnumerator to access the data from the enumerator rowset. This rowset consists of the data sources and enumerators visible from the current enumerator.
- Represents a single database access session. One or more sessions can be associated with each CDataSource object.
- Used for records that are statically bound to a data source. Use this accessor class when you know the structure of the data source.
- Base class for all accessor classes.
- An accessor that can be created at run time, based on the column information of the rowset. Use this class to retrieve data if you do not know the structure of the data source.
- An accessor that can be used when command types are unknown. Obtains the parameter information by calling the ICommandWithParameters interface, if the provider supports the interface.
- Allows you to access a data source when you have no knowledge of the database's underlying structure.
- Similar to CDynamicStringAccessor except that this class requests data accessed from the data store as ANSI string data.
- Similar to CDynamicStringAccessor except that this class requests data accessed from the data store as UNICODE string data.
- An accessor with methods to handle both columns and command parameters. With this class, you can use any data types as long as the provider can convert the type.
- Can be used as a template argument when you do not want the class to support parameters or output columns.
- Similar to CDynamicStringAccessor except that this class converts all data accessed from the data store as XML-formatted (tagged) data.
- Encapsulates a rowset and its associated accessors.
- Used to access elements of a rowset using array syntax.
- Used to fetch and manipulate rows in bulk by retrieving multiple row handles with a single call.
- Can be used as a template argument if the command does not return a rowset.
- Used to specify restrictions for schema rowsets.
- Used to manipulate, set, and retrieve rowset data.
- Returns an ISequentialStream object rather than a rowset; you then use the Read method to retrieve data in XML format. (SQL Server 2000 does the formatting; note that this feature works with SQL Server 2000 only.)
- Provides a dummy implementation for IRowsetNotify, with empty functions for the IRowsetNotify methods OnFieldChange, OnRowChange, and OnRowsetChange.
The OLE DB Templates provide you with a set of classes that correspond to the OLE DB schema rowsets.
- Used to set and execute a parameter-based OLE DB command. To merely open a simple rowset, use CTable instead.
- Used as a template argument for the CCommand template when you want the command to handle multiple result sets.
- Used as a template argument for template classes, such as CCommand and CTable, that take an accessor class argument. Use CNoAccessor if you do not want the class to support parameters or output columns.
- Used as a template argument for the CCommand template when you want the command to handle a single rowset. CNoMultipleResults is the default value for the template argument.
- Used as a template argument for CCommand or CTable if the command or table does not return a rowset.
- Used to access a simple rowset with no parameters.
- Used to pass an array of property IDs for which the consumer wants property information. The properties belong to one property set.
- Used to set properties on a provider.
- Used as an index for accessing data in a rowset.
- Used to retrieve OLE DB error information.
See the ConfirmUser Sample and the ShowImage Sample.