Using the Execute Method
Go Up to Working with ADO components Index
Before TADOCommand can execute its command, it must have a valid connection to a data store. This is established just as with an ADO dataset. See Connecting an ADO Dataset to a Data Store for details.
To execute the command, call the Execute method. Execute is an overloaded method that lets you choose the most appropriate way to execute the command.
For commands that do not require any parameters and for which you do not need to know how many records were affected, call Execute without any parameters:
with ADOCommand1 do begin CommandText := "UpdateInventory"; CommandType := cmdStoredProc; Execute; end;
ADOCommand1->CommandText = "UpdateInventory"; ADOCommand1->CommandType = cmdStoredProc; ADOCommand1->Execute();
Other versions of Execute let you provide parameter values using a Variant array, and to obtain the number of records affected by the command.
For information on executing commands that return a result set, see Retrieving Result Sets with Commands.