Creating Rowsets

A consumer obtains a rowset object in one of the following ways:

  • The consumer calls IOpenRowset::OpenRowset on the current session object to create a rowset directly. All providers must support IOpenRowset.

  • The consumer calls IDBCreateCommand::CreateCommand on the session object to obtain a command object. The consumer then calls ICommand::Execute on the command object. If the command is one that returns rows, such as an SQL SELECT statement, ICommand::Execute returns either a rowset or, if the consumer has requested IMultipleResults, a multiple results object.

  • The consumer invokes a method that returns a rowset or schema rowset, such as IColumnsRowset::GetColumnsRowset, IDBSchemaRowset::GetRowset, IViewRowset::OpenViewRowset, or ISourcesRowset::GetSourcesRowset.

  • The consumer calls some other method that returns tabular results as a rowset.

This section contains the following topics: