Rx QBE Queries

RX Library

Control Name Unit Class
RX QBE Queries DBQbe TQBEQuery

Description:
The non-visual TQBEQuery component allows you to specify Paradox-style Query-By-Example query statements that are used to supply data to one or more of the other visual interface components placed on your form.

Multiple table queries and special queries such as Insert, Delete and ChangeTo queries are also supported. Since TQBEQuery component is inherited from Delphi’s TDBDataSet component, the Delphi Fields editor is still available within this component. If you want the normal auxiliary QBE tables written to your hard drive, set the AuxiliaryTables property to True. When defining QBE statements, it’s a very good idea to create, fully test and then save your query via the Database Desktop or the native application (Paradox or dBASE for Windows). Then, click the Load button of the QBE string editor to load this saved query file into the editor. These environments make it much easier to create, test and validate the results of a QBE than the services provided in Delphi. If you know more about SQL than Paradox-style QBE, or if your tables are from an SQL database, you might want to consider using the TQuery or TRxQuery component instead.


Using class TQBEQuery

If you receive the error message "Error creating cursor handle" when executing your QBE, it means that your query was unable to be executed. Likely causes are incorrect syntax in your QBE specification, unopened aliases, or missing tables.


Property AuxiliaryTables
Declaration: AuxiliaryTables: Boolean;

This property tells the QBE processor whether or not to create the standard auxiliary tables (keyviol, changed, inserted, etc.). When an auxiliary table is created, it remains on your disk until it is deleted. If an auxiliary table already exists, it will be overwritten without warning. The default value is True.

CAUTION: If you set this property to False, you may not be able to fully check the results of your QBE since no auxiliary tables will be created for manual verification.


Property BlankAsZero
Declaration: BlankAsZero: Boolean;

When True blanks in numeric fields in a table are treated equivalent to a zero. The default value is False.


Property ParamCheck
Declaration: ParamCheck: Boolean;

The ParamCheck property determines whether the query fills the Params array when the SQL or QBE property is changed at run time. Default is True.


Property QBE
Declaration: QBE: TStrings;

This property holds the actual QBE query statements. After creating a query via the Database Desktop, or from within Paradox for Windows, save the query as a .QBE file (File | Save menu options). You can then load this previously saved file into the Delphi String list editor window for the QBE property by clicking on the Load button and selecting the file you previously saved. Optionally, you can specify the QBE statements interactively. The default value is blank - no QBE defined.

NOTES: The contents of the "ANSWER:" QBE statement generated when you save a query to a file are ignored by the BDE QBE processor. The contents of the Selected Fields list box of the Select Fields dialog box default to all fields that are selected via the QBE statements contained in the QBE property.


Property StartParam
Declaration: StartParam: Char;

StartParam determines character which indicates parameter in the QBE query text (default value is '#').


Method ExecQBE
Declaration: procedure ExecQBE;

Use the ExecQBE method to execute an QBE statement assigned to the QBE property of a TQBEQuery if the statement does not return a result set. If the QBE statement is an INSERT, UPDATE, DELETE, or any DDL statement, then use this method.


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000