RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TADODataSet.CommandType Property

Specifies the type of command to execute.

Pascal
property CommandType: TCommandType;
C++
__property TCommandType CommandType;

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();

 

commandtext 

Open 

CommandTimeout 

Using TADODataSet

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!