Chapter 3: Commands

OLE DB Programmer's Reference

This chapter discusses the use and states of command objects, processing multiple result sets, binding input parameters and using output parameters, and the use of rowset properties in command objects. Commands can be in one of four states: Initial, Unprepared, Prepared, or Executed. Parameters can be used with commands to bind to consumer variables at execution time. When executed, a command returns either a single result, which can be either a rowset object or a row count, or multiple results, which must be returned in a multiple results object.

For more information on Go to
Using commands "Using Commands" in this chapter
Command states "Command States" in this chapter
Input and output parameters "Using Parameters" in this chapter
Multiple results "Multiple Results" in this chapter

A command object is used to execute a provider-specific text command, such as an SQL statement. Text commands are expressed in a provider-specific language—usually SQL-92—and are generally used for creating a rowset—for example, executing an SQL SELECT statement.

Providers are not required to support commands. In general, providers built on top of a DBMS, such as an SQL DBMS, support commands, and providers built on top of a simple data structure, such as a file or an array of data in an application, do not support commands.

The command object cotype is defined as follows. For more information about cotypes, see "Conceptual Programming Models in OLE DB" in Chapter 1: Overview of OLE DB.

CoType TCommand {    [mandatory]   interface IAccessor;    [mandatory]   interface IColumnsInfo;    [mandatory]   interface ICommand;    [mandatory]   interface ICommandProperties;    [mandatory]   interface ICommandText;    [mandatory]   interface IConvertType;    [optional]    interface IColumnsRowset;    [optional]    interface ICommandPersist;    [optional]    interface ICommandPrepare;    [optional]    interface ICommandWithParameters;    [optional]    interface ISupportErrorInfo;    [optional]    interface ICommandStream; }

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net