CommandType Property

The CommandType property on a Command object Indicates the type of a Command object. This property sets or returns a CommandTypeEnum value.

oldType = command.CommandType
command.CommandType = newType
 

Remarks

The CommandType property is used to set or return the type of a Command object. This property specifies a CommandTypeEnum value that can be one of the following constants:

Enumeration Value Description
adCmdUnspecified -1 This value indicates that the CommandType property has been unspecified.
adCmdText 1 This value evaluates the CommandText property as a textual definition of a command.
adCmdTable 2 This value evaluates the CommandText property as a table name (not supported by the OLE DB Provider for AS/400 and VSAM).
adCmdSToredProc 4 This value evaluates the CommandText property as a stored procedure (not supported by the OLE DB Provider for AS/400 and VSAM).
adCmdUnknown 8 This value indicates that the type of command in a CommandText property is not known.

The OLE DB Provider for AS/400 and VSAM only supports the adCmdText type for the CommandType property. If any other value for the CommandType property is set, errors will occur.