RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TQuery Class

TQuery represents a dataset with a result set that is based on an SQL statement.

Pascal
TQuery = class(TDBDataSet);
C++
class TQuery : public TDBDataSet;

Use TQuery to access one or more tables in a database using SQL statements. Query components can be used with remote database servers (such as Sybase, SQL Server, Oracle, Informix, DB2, and InterBase), with local tables (Paradox, InterBase, dBASE, Access, and FoxPro), and with ODBC-compliant databases. 

Query components are useful because they can 

Access more than one table at a time (called a "join" in SQL). 

Automatically access a subset of rows and columns in its underlying table(s), rather than always returning all rows and columns.

Note: TQuery is of particular importance to the development of scalable database applications. If there is any chance that an application built to run against local databases will be scaled to a remote SQL database server in the future, use TQuery components from the start to ensure easier scaling later.
 

 

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