Data.Win.ADODB.TADOQuery.ExecSQL

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: function
Visibility: public
Source:
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Unit: Data.Win.ADODB
Parent: TADOQuery

Delphi

function ExecSQL: Integer; {for TQuery compatibility}

C++

int __fastcall ExecSQL();

Description

Executes the SQL statement for the ADO query.

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.

See Also