RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TADOCommand.Execute Method ()

Causes the ADO command object's command to be executed.

Pascal
function Execute: _Recordset; overload;
function Execute(const Parameters: OleVariant): _Recordset; overload;
function Execute(var RecordsAffected: Integer; const Parameters: OleVariant): _Recordset; overload;
C++
__fastcall _Recordset Execute();
__fastcall _Recordset Execute(const OleVariant Parameters);
__fastcall _Recordset Execute(int RecordsAffected, const OleVariant Parameters);

Call Execute to immediately execute the command specified in the CommandText property. 

RecordsAffected indicates the number of records, if the command operates on data, that are affected by the command after execution. 

Parameters is a collection of parameters for the command, unnecessary if the command does not use any parameters. 

When a command is executed that creates a recordset, Execute returns the recordset and it must be accessed through an ADO dataset component. To do this, assign the return value of Execute directly to the recordset property of an ADO data set component. For example:

ADODataSet1.Recordset := ADOCommand1.Execute;

 

ADODataSet1->Recordset = ADOCommand1->Execute();

 

TParameters 

Cancel 

CommandObject 

CommandType 

CommandText 

Canceling Commands 

Handling Command Parameters 

Retrieving Result Sets with Commands 

Using the Execute Method

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