Bde.DBTables.TQuery.Prepare
Delphi
procedure Prepare;
C++
void __fastcall Prepare(void);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Bde.DBTables.pas Bde.DBTables.hpp |
Bde.DBTables | TQuery |
Description
Sends a query to the Borland Database Engine (BDE) and the server for optimization prior to execution.
Call Prepare to have the BDE and a remote database server allocate resources for the query and to perform additional optimizations. Preparing a query consumes some database resources, so it is good practice to call UnPrepare once the query is no longer needed.
If the query will only be executed once, the application does not need to explicitly call Prepare or UnPrepare. Executing an unprepared query generates these calls automatically. However, if the same query is to be executed repeatedly, it is more efficient to prevent these automatic calls by calling Prepare and UnPrepare explicitly.
Note: When you change the text of a query at runtime, the query is automatically closed and unprepared.