Creating a Rowset with a Command

Providers that implement their own query or data definition language can offer their consumers additional functionality by using a command. This process involves three steps:

  1. The consumer creates a session. For more information, see "Sessions" in Chapter 2.

  2. The consumer calls IDBCreateCommand::CreateCommand on the session to get a command. The command holds a text command. The consumer then fills in the text command, thereby stating what data to return in the rowset. The text command can be expressed in SQL and augmented by properties that request various functional services upon the resulting rowset. For more information about properties, see "Setting Rowset Properties" later in this chapter.

  3. The user calls ICommand::Execute on the command. Execute returns a rowset. See the following figure.

Getting a rowset from a session through a command