Command Object Definitions

Command Object allows you to manipulate database commands. Although you can execute a command string on a Connection Object or as part of opening a Recordset Object, the Command Object allows you more flexibility. Chief among its extended functionalities is the ability to add, remove, and define query parameters using the Command Object's Parameter Collection. You can define the text of a database command, such as a SQL statement, using the CommandText Property of the Command Object.
  • ActionConnection - The name of the Connection Object to which the Command Object belongs.
  • CommandText - A string containing the text of the command you wish to execute against the database. It can be a query, a SQL statement, the name of a stored procedure, or some other database manipulation command.
  • CommandType - The type of command that is executed using the Command Object
    • adCmdText - The command is a text command, such as a simple SQL statement; CommandText is evaluated as a textual definition of a command.
    • adCmdTable - The Command Object represents a table; CommandText is evaluated the name of a table.
    • adCmdStoredProc - The Command Object represents a stored procedure; CommandText is evaluated as the name of a stored procedure in the underlying data provider.
    • adCmdUnknown - The Command Object type is unknown; this the default value.
  • Execute - Executes the command contained in the Command Object's CommandText Property.