MDAC 2.5 SDK - OLE DB Providers
OLE DB Provider for SQL Server
A rowset is a set of rows that contain columns of data. Rowsets are central objects that enable all OLE DB data providers to expose result set data in tabular form.
After a consumer creates a session by using the IDBCreateSession::CreateSession method, the consumer can use either the IOpenRowset or IDBCreateCommand interface on the session to create a rowset. The SQLOLEDB provider supports both of these interfaces, and following are descriptions of both methods:
This is equivalent to creating a rowset over a single table. This method opens and returns a rowset that includes all the rows from a single base table. One of the arguments to OpenRowset is a table ID that identifies the table from which to create the rowset.
The command object executes commands that the provider supports. In SQLOLEDB, the consumer can specify any Transact-SQL statement (such as a SELECT statement or a call to a stored procedure). Following are the steps for creating a rowset by using a command object:
The consumer can use the ICommandProperties interface to get or set the properties for the rowset returned by the command executed by the ICommand::Execute interfaces. The most commonly requested properties are the interfaces the rowset must support. In addition to interfaces, the consumer can request properties that modify the behavior of the rowset or interface.
Consumers release rowsets with the IRowset::Release method. Releasing a rowset releases any row handles held by the consumer on that rowset. Releasing a rowset does not release the accessors. If you have obtained an IAccessor interface, it still needs to be released.