CCommand Class
Provides methods to set and execute a command.
template <
class TAccessor = CNoAccessor,
template < typename T > class TRowset = CRowset,
class TMultiple = CNoMultipleResults
>
class CCommand :
public CAccessorRowset <
TAccessor,
TRowset
>,
public CCommandBase,
public TMultiple
Parameters
TAccessor
The type of accessor class (such as CDynamicParameterAccessor, CDynamicStringAccessor, or CEnumeratorAccessor) that you want the command to use. The default is CNoAccessor, which specifies that the class not support parameters or output columns.TRowset
The type of rowset class (such as CArrayRowset or CNoRowset) that you want the command to use. The default is CRowset.TMultiple
To use an OLE DB command that can return multiple results, specify CMultipleResults. Otherwise, use CNoMultipleResults. For details, see IMultipleResults.
Members
Methods
Closes the current command. |
|
Fetches the next result when using multiple result sets. |
|
Executes and optionally binds the command. |
Inherited Methods
Creates a new command for the specified session, then sets the command text. |
|
Creates a new command. |
|
Gets a list of the command's parameters, their names, and their types. |
|
Validates and optimizes the current command. |
|
Releases the parameter accessor if necessary, then releases the command. |
|
Specifies the native type of each command parameter. |
|
Discards the current command execution plan. |
Remarks
Use this class when you need to perform a parameter-based operation or execute a command. If you merely need to open a simple rowset, use CTable instead.
The accessor class you are using determines the method of binding parameters and data.
Note that you cannot use stored procedures with the OLE DB Provider for Jet because that provider does not support stored procedures (only constants are allowed in query strings).
Requirements
Header: atldbcli.h