RAD Studio VCL Reference
TADOCommand.Execute Method ()

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

function Execute: _Recordset; overload;
function Execute(const Parameters: OleVariant): _Recordset; overload;
function Execute(var RecordsAffected: Integer; const Parameters: OleVariant): _Recordset; overload;
__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();


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!