Copyright: 0.91 (preview version)


QueryInfo Component Pack

version 0.91 (preview release)

Thanks for having a look at this preview of my forthcoming attraction.

I have been toiling on my own for a fair while and would love some feedback!

Contents

Introduction

QI Components

Other included components

What’s new in this version

Useage guidelines

Future plans, ideas

Author

Copyright, restrictions


Introduction

How many SQL builder components have you downloaded and sampled?

Do they generally have the following in common?

•	Large size - inflating the size of your program (and DCL)

•	Monolithic - little to no flexibility or configurability

•	Little control over what the user can access and do

•	Present the user with a succession of complex dialogs

•	Display table and field names in their raw form, eg.:LOCAL:ORD_PEND.CONS_INV

•	Expose the end user to SQL terminology

•	Expensive to register

Wouldn’t it be nice if -

•	It comprised of multiple optional, interchangeable components (scaleable)

•	It did not need to promote your program to the heavyweight division

•	The data in the base component was accessable, flexible and logically organised

•	The API was comprehensive, consistent and well documented

•	There were useful manipulation and formatting routines

•	You had complete control over what fields the user could use and how they used them

•	All fields, operators, etc could have “layman” names

•	You could create your own custom interfaces, editors, formatters where desired

•	Components & stuff from other people designed to work with it become available

•	Won’t empty your wallet

What I would like to achieve :-

•	Develop a universal query information container (TQueryInfo) designed to be used by custom query builders both as a source for information on the relevant database, tables and fields on which queries can be performed aswell as the receptacle for their results. Other affiliate components can perform tasks such as building SQL scripts, validation, displaying query results, archiving, etc.

•	Produce a comprehensive and high quality set of supplementary components.

•	Getting other people to produce components using TQueryInfo.

•	Make contact with other people using Delphi

•	Make some money!

Unfortunately TFieldInfo and TQueryInfo have got rather large, partially due to the effort in supplying a usefull API, so my hopes of producing something lean and mean did not matarialize - at least not the lean part.

All in all, I feel the result meets most of my ideal, and hope that it proves to be usefull.


QIComponents component

QI Components

version

0.91   preview release

TFieldInfo	(see qiField.hlp)

Persistent storage of field information, their tables and joins.

TQueryInfo	(see qiQuery.hlp)

Runtime storage of query information.

TQISelectDialog	(see qiSelect.hlp)

Stores user field selections, plus any aggregate calculation.

TQIFilterDialog 	(see qiFilter.hlp)

Builds the ‘WHERE’ part of the query.

TQIGroupDialog	(see qiGroup.hlp)

Defines the ‘GROUP BY’ part of the query. I have included the source of this to give you some insight into the workings and concept of TQueryInfo, and to encourage you make your own editors for it!

TQIOrderDialog	(see qiOrder.hlp)

Defines the ‘ORDER BY’ part of the query.

TQIFormatter	(see qiFormat.hlp)

Contains formatting routines for producing an SQL query script from the information contained in TQueryInfo, aswell as a user version for status line display.  I have included the source as this component should be customized/subtyped, not TQueryInfo.  Also demonstrates how to get the query information out.

TQIArchiver	(see qiArchive.hlp)

Stores query information in Paradox tables - accessed via built-in load and store dialogs.

TQIQueryWindow	(see qiWdw.hlp)

Uses the output of TQIFormatter to execute the query contained in TQueryInfo and display the result. Can also be used to launch query editors/builders aswell as load, save, print and report functions.

TQILookupDialog	(see qiLookup.hlp)

Does field value lookups. Features incremental searching.

TQIFilterBuilder	(see qiFrBldr.hlp)

Alternative to TQIFilterDialog. Field filter senteces are built via drop down lists and popup values editor and support for parenthesis. These lines can be dragged around.


Other included components

TMemoDialog

A simpler TStrings editor. Full source.

TTablePrinter

A basic dataset printer. The BodyFont font must be fixed pitch (eg Courier New) or the column formatting will be a disaster!. Full source to use or abuse.

Watch out for the following freeware components -

TLinker	Keeps persistent associations between other components.

TEditManager	Manages edit controls and dataset, can generate edit controls.

TSplitBar	Yes, another one - but it works (used in TQIQueryWindow).

TProgressWindow	A convenient popup progress indicator.

You may also see my RGBMixer program - mix a custom color, then cut and paste it into the Color property of a component (eg TPanel).

Full demo program

I will probably release Stocker, a small general purpose stock-keeping program which is a convenient core for a custom job, as full source freeware. Contains the above freeware components plus an early version of QueryInfo which I first want to update to this version, etc.

Would have liked to have included it with this, but will add a lot more to the archive size, which is already rather large, as you will agree!


What's new in this version
What’s new in the version

Previous version: 0.9

The really big change (sorry about this) is that the persistent field, table and join information has been split off into a separate TFieldInfo component which connects to a TQueryInfo component. This seems more logical and also paves the way for creating nested queries by using several QueryInfos using the same FieldInfo (the “Holy Grail” of query builders?).

Can prevent TFieldInfo from accepting duplicate field or table items.

Have prevented field items from having any usage attributes from being set if any key properties are unassigned or is of an unsupported field type, eg. ftGraphic.

The TFieldInfo DatabaseName, Tables and Fields design time property editors now support values lookup via the BDE.

Changed the About property - was troublesome as previously implemented.

All component and property editor registrations are consolidated into qiReg.pas and all components bitmaps are consolidated into qiReg.dcr.

TQIArchiver can now also store the field information associated with the stored query if required. Vital if the fields can change at runtime. Also the loader can be used as a modeless browse window.

TFilterDialog is different - similar in style to the other dialogs. The original is still included as TQIFilterBuilder as an alternative.

In TQISelectDialog, any aggregations can be hidden.

Fixed things here and there…


Usage guidelines

All components that are designed to use TQueryInfo directly should -

•	Use a published property called QueryInfo that connects to a TQueryInfo instance

•	Contain a NotifyEvent method to handle the deletion of a connected QueryInfo

•	If a dialog, execute via an Execute method which returns ‘True’ on mrOK

•	Use the user names (UserName) in the user interface

•	Apply the TField’s properties if the defined field is associated with a TField (a FieldRef)

•	Only make available those fields as defined by their field usage

•	Invoke the relevent OnChange events

It could be a good idea if the components -

•	Are prefixed with “QI” in their type name and “qi” in unit name and on their bitmap

•	Have “QI” as the default component palette page

•	Are kept as modular and lightweight as possible

•	Are kept fairly cheap

* Refer to qiField.hlp & qiQuery.hlp on the above italisized terms.


Future plans

Improve the nesting mechanism in the filters - maybe use a nesting list.

Multi database support?

Give more thought to how to implement joins and avoid recursion caused querying tables with no direct joins defined. Auto joining. Also improve the joins editor.

Improve the documentation (even thought its a real schlep), making it more like the Delphi VCL help. I prey for the inclusion of say a RoboHelp Delphi Edition with a component writer’s help template in Delphi 3!

Ensuring that the data storage design meets as many requirements as practically possible - SQL is rather a complex field.

Improve the property editors, perhaps getting tables and fields from the BDE, but don’t want to duplicate too much functionality already supplied in the Delphi IDE and bloat a user’s DCL file even further!  I should, I suppose, add checking for undefined key properties and duplications and so on, but these are after all interfaces for the developer and not the end user, and you don’t want to be treated like a baby do you?

Greatly improving my subsidiary component support and hopefully competing with the likes of you therewith. In the pipeline is an expert style query builder, an end-user calculated field definer, some sort of nested query builder (can be implemented by using several TQueryInfos

connected to a TFieldInfo - the required logic will probably be sticky), a Query By Example dialog, perhaps…

Can always change the runtime-only query storage properties to being persistent (assignable at design time) if that requirement become evident.

Getting a good SQL reference. I have not had much SQL exposure and hope it does not show too much!

A 16 bit version shouldn’t be any problem, if there’s a need for it.


The author

F.Justin Turberville

postal mail	P.O.Box 122

Kenton-on-Sea

6191

South Africa

email	JustinT @ cyberjoe.co.za

telephone	(0464) 81924

Note that my email address is 150 km away (in Port Elizabeth) from where I live so don’t expect any prompt reaction - I will try to go down and check things out at least every weekend to start with and maybe improve matters, depending on what response I get, if any…

I have not finalized registration details yet but envisage something like $25 for the whole pack (excluding full source).

Send me a message if you are so desperate to part with your bucks (some good suggestions and constructive critisism could well come into the reckoning) or just keep a watch on where you downloaded this for version 1, which will have registration details. I will let you know if you ask.


Restrictions and copyright

Restrictions

This is a preview release and as such should only be compiled into a program for evaluation purposes. A message box to this effect is displayed on creation. Also, the included dialog components only execute with Delphi running.  A registered version of the upcomming commercial release of version 1.0 will not nag in any way, naturally.

You are welcome, in fact encouraged (even implored) to write subsidiary components (components that are designed to work with TQueryInfo) as long as TQueryInfo itself is not altered, sub-typed, cloned, or supplied in non-demo (unrestricted) form with your components without my permission. Your demo and freeware components do not require any licencing or royalty on my part, but any commercial products (including shareware) is bound to require a licensing/royalty agreement with me (well, Bill Gates got away with doing it!). I intend this to be minimal and hassle-free. The same applies to replacement property editors.

It is important that I remain in control of the TQueryInfo format for obvious compatability reasons, and to be straight with you, for commercial gain - any user of your subsidiary components will have to buy TQueryInfo from me (who wouldn’t like to play Bill Gates in a small way?). Someone has to control the standard - me!  The potential benefit for you is a variety of compatable and interchangeable components from different sources to cover most database programming needs. I could also maintain a registry of type names to prevent clashes.

You may only redistribute this software in its original form (archive) and without charge, unless you get my express accent.

Indemnity

This software has quarantee express or implied, and the author takes no responsibility for the consequences of its use. Be warned that this is beta (even alpha) software and should be treated as such.

TFieldInfo, TQueryInfo, TQIArchiver, TQIFormatter, TQISelectDialog, TQIFilterDialog, TQIGroupDialog, TQIOrderDialog, TQIQueryWindow, TQIFilterBuilder and TQILookupDialog are copyright  1996 by F. Justin Turberville.