OLE DB Components
OLE DB defines the following components, each of which is a COM object:
-
Enumerators search for available data sources and other enumerators. Consumers that are not customized for a particular data source use enumerators to search for a data source to use.
-
Data source objects contain the machinery to connect to a data source, such as a file or a DBMS. They are a factory for sessions.
-
Sessions provide a context for transactions and can be implicitly or explicitly transacted. A single data source object can create multiple sessions. Sessions are a factory for transactions, commands, and rowsets.
-
Transaction objects are used when committing or aborting nested transactions at other than the lowest level.
-
Commands execute a text command, such as an SQL statement. If the text command specifies a rowset, such as an SQL SELECT statement, the command is a factory for the rowset. A single session can create multiple commands.
-
Rowsets expose data in tabular format. A special case of a rowset is an index. Rowsets can be created from the session or the command.
-
Errors can be created by any interface on any OLE DB object. They contain additional information about an error, including an optional custom error object.
For example, a consumer might use the following objects.
Typical use of OLE DB components by a consumer