Copyright: 0.9 1 (preview release)


TQIQueryWindow component

Note: In qi09 this component was TQIQueryWindow in qiQuery.dcu/dfm. qiQuery now contains TQueryInfo which has had TFieldInfo (qiField.dcu/dfm) split from it.

This component is mainly designed as an answer window for ad hoc queries. The tool buttons (only visible if their handlers are assigned) make it usefull as a controller for invoking query editing dialogs. Call Show the show the window, assign the SQLScript property and call ExecuteQuery to display the query result.  Does not require QueryInfo to operate, but uses its information for adjusting the field properties if assigned.

properties

Caption, DatabaseName, QueryInfo, RequestLive, DisplayScript, SQLScript, DisplayScript, CanModify, QuerySource, Visible

methods

Show, Hide, ExecuteQuery, CloseQuery, Refresh

events

OnSelect, OnFilter, OnOrder, OnEditSQL, OnLoad, OnSave, OnLookup, OnFindNext, OnPrint, OnReport, OnPlot

files

qiWdw.dcu/dfm	unit & form resource

qiWdw.hlp	hypertext help reference (this file)


Refresh method

Re-executes the query.

declaration

procedure Refresh;


Show method

Shows the window.

declaration

procedure Show;


Hide method

Hides the window.

declaration

procedure Hide;


ExecuteQuery method

Executes the query. Ensure that SQLScript is assigned. Returns True if successfull.

declaration

function ExecuteQuery: Boolean;


CloseQuery method

Closes the dataset.

declaration

procedure CloseQuery;


Caption property

Appears as the window’s caption.

type

string

stage

design time 	run time

access

read 	write


DatabaseName property

The name of the database used. Obtained from QueryInfo if assigned.

type

string

stage

design time 	run time

access

read 	write


QueryInfo property

References the TQueryInfo component. If assigned, its field definitions are used with the TFields that are dynamically created on the execution of the query - ie DisplayLabel is given the UserName, fields not represented in Selections are hidden, those that reference a statically defined TField have their property settings assigned to the dynamically created corresponding TField.

type

TQueryInfo

stage

design time 	run time

access

read 	write


RequestLive property

Equates to TQuery.RequestLive. If set, edit buttons are shown, and are enabled if a live result set is returned.

type

Boolean

stage

design time 	run time

access

read 	write


SQLScript property

Contains the SQL query script sent to the BDE on execution.

type

TStrings

stage

design time 	run time

access

read 	write


DisplayScript property

If assigned, a resizeable panel displays its contents above the data grid. Use to display the user-orientated version of the query script.

type

TStrings

stage

design time 	run time

access

read 	write


Visible property

Check to find out if the window is being shown.

type

Boolean

stage

run time only

access

read only


CanModify property

Informs whether the result set can be edited.

type

Boolean

stage

run time only

access

read only


QuerySource property

Gives read access to the encapsulated TDataSource component for access to the dataset.

type

TDataSource

stage

run time only

access

read only


OnSelect event

Called by a “Select” speedbutton which is only visible if this handler is assigned. Use to execute a field selections editor.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnFilter event

Called by a “Filter” speedbutton which is only visible if this handler is assigned. Use to execute a field filtering editor.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnOrder event

Called by a “Sort” speedbutton which is only visible if this handler is assigned. Use to execute a field ordering editor.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnEditSQL event

Called by a “Edit SQL” speedbutton which is only visible if this handler is assigned. Use to execute a SQL script editor.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnLoad event

Called by a “Load query” speedbutton which is only visible if this handler is assigned. Use to execute a query loading operation.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnSave event

Called by a “Save query” speedbutton which is only visible if this handler is assigned. Use to execute a save query operation.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnLookup event

Called by a “Lookup value” speedbutton which is only visible if this handler is assigned. Use to execute a field value lookup. Can be used in conjunction with the FindFirst and FindNext utility routines in qiInfo.dcu and the QuerySource property to locate records within the dataset.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnFindNext event

Called by a “Find next” speedbutton which is only visible if this handler and the OnLookup handler are assigned. Use to find the next record.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnPrint event

Called by a “Print” speedbutton which is only visible if this handler is assigned. Use to print the contents of the dataset.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnReport event

Called by a “Report” speedbutton which is only visible if this handler is assigned. Use to execute a report on the dataset.

type

TNotifyEvent

stage

design time	run time

access

read	write


OnPlot event

Called by a “Plott” speedbutton which is only visible if this handler is assigned. Use to execute a graph plotter on the dataset.

type

TNotifyEvent

stage

design time	run time

access

read	write