RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAdoDbxCommand.CommandType Property

Gets or sets the CommandType that indicates how to interpret the CommandText property.

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

When you set the CommandType property to StoredProcedure, you should set the CommandText property to the name of the stored procedure. The command executes this stored procedure when you call the ExecuteScalar, ExecuteReader, or ExecuteNonQuery methods. The Connection, CommandType and CommandText properties cannot be set if the current connection is performing an execute or fetch operation.  

AdoDbxClient supports the ? symbol as a placeholder for passing parameters to a SQL statement or a stored procedure called by a TAdoDbxCommand when CommandType is set to Text.

Type 
Description 
Text  
A SQL command. Default.  
TableDirect  
If you set the CommandType property to TableDirect, set the CommandText property to the name of the table you want to access. You might need to use escape characters or other qualifying characters if the tables contain special characters. When you call one of the Execute methods, the query returns all rows and columns.  
StoredProcedure  
The name of a stored procedure.  

 

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