RAD Studio VCL Reference
TADOQuery.ExecSQL Method

Executes the SQL statement for the ADO query.

function ExecSQL: Integer;
__fastcall int ExecSQL();

Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE). 

ExecSQL returns an integer value reflecting the number of rows affected by the executed SQL statement.

Note: For SELECT statements, call Open instead of ExecSQL or set the Active property to true.
To speed performance, an application should ordinarily prepare the query by setting the Prepared property to true before calling ExecSQL for the first time. 


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