Data.Win.ADODB.TCustomADODataSet.CommandType

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property CommandType: TCommandType read GetCommandType write SetCommandType default cmdText;

C++

__property TCommandType CommandType = {read=GetCommandType, write=SetCommandType, default=1};

Properties

Type Visibility Source Unit Parent
property protected
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TCustomADODataSet

Description

Specifies the type of command to execute.

Set CommandType to indicate the type of command that is contained in the CommandText property. The value in CommandType should agree with that of CommandText. For instance, if CommandText is the name of a table, CommandType should be cmdTable or cmdTableDirect.

The default value of CommandType is cmdUnknown. While CommandType may be left as cmdUnknown for all commands, better performance will be realized if CommandType is used to explicitly indicate the type of the command. When the type cmdUnknown is used, ADO must evaluate the command to determine its type, which slows the operation.



with ADODataSet1 do begin
CommandType := cmdText;
CommandText := 'SELECT * FROM CustomerTable';
Open;
end;



ADODataSet1->CommandType = cmdText;
ADODataSet1->CommandText = "SELECT * FROM CustomerTable";
ADODataSet1->Open();



See Also