Condividi tramite


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.

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

See Also

Concepts

OLE DB Consumer Templates (C++)

OLE DB Consumer Templates Reference

Other Resources

CCommand Members