Documentation for Jayan's Query Tools Components : The documentation for TQueryByFilter has been given.  TQueryBySQL component has not been completed.  Please read this documentation fully.

Created & Developed By :  Jayan Chandrasekhar,  Riyadh, Saudi Arabia.

Web - Site                         :  www.crosswinds.net/~delphitoday

Email                                :  jayanck@email.com


Installation :

Please install the component TKbmMemTable before you install QueryTools.  This is an excellent Memory Table component written by Kim Bo Madsen.  I have included the Zip file.  To get the latest version of  KbmMemTable you can go to  http://www.onelist.com/community/memtable.

To install QueryTools you have to install the package QueryTools.dpk.  This is made for Delphi 5.  For Delphi 3 and 4 you can make your own package by adding  JQryTool.pas.

Disclaimer :  This component is a freeware and you can use it at your own Risk.                           

Foreword  :  This component is a result of hours of hard work.  I would like to share and dedicate it to the entire Delphi Community which consists of  Delphi programmers who have created many innovative freeware softwares.  This component is limited to my knowledge of Delphi and experiences.  All sort of suggestions are welcome.  I would appreciate if you can email me and tell as to how you have found this component useful.  Soon I will also be releasing TQueryBySQL. 


TQueryByFilter  

Introduction

The aim of this Component is to provide the Delphi Programmers an easy way to implement Filtering  in their programs. That is, as the user works with a form designed by you a Delphi programmer, the user can on the fly during run-time see the data you present as per his requirements. For instance your form may provide employee-details . The user who is browsing through the data may want to see all the Male Employees from one particular Country. Usually you will have to provide for such Queries by providing some button and writing code. That too if the user has informed you while the program was being designed. If there are lets say 20 fields on the form the user should be able to Query any way he wants. The components  TQueryByFilter can help you do so without much effort just that by providing you 3 object methods. Now the user can query the employee data provided by you on the form in any way he pleases. Here are some examples. He may want to see the employee data in 1 of the following ways :

You the programmer need not know in advance how the user is going to query. The user at run-time would do so by entering the criteria in the fields on your form - the same form you have provided.  No other Form is used for this purpose.  He can also use relational operators provided by  pressing the Control and Alt Key together  and selecting from the relational operator PopUpMenu while in the field. On executing , the Table or Query will reflect the users selection in the result set.  TQueryByFilter provides this feature by using the Filter property of TTable / TQuery.

How To Use TQueryByFilter Component ?  ( Please check the Demo )

 

 

 

 

 

 

 

Thus you can have the Relational Operators Equal-To (default), Not-Equal-To, Greater-Than, Less-Than, Between, Not-Between, In list, Not-In List, Is Null, Is-Not Null.

Also you can have Match-Any or Match-All, any one, at one particular time.

All the above things can be done with DBGrid also.  Only that you have to select the Grid property.

Properties :

Methods : Relational Operators available on clicking the Control + Alt Keys while in qsGetCriteria state :
 
Relational Operators Explanation
Equal To, Not Equal To, Less Than, Greater Than No explanation required
Between & Not Between The From part of the Between Range to be entered in the Field itself and when Between or Not Between is selected from the Relational Operator PopUpMenu the To part to be entered in the InputBox which pops up on selection.
In & Not In This is nothing but the SQL IN operator in the WHERE clause. You do not have to enter anything in the Field. When you select IN from the PopUpMenu an InputBox pops up where you can enter all the values seperated by commas. If string values are not entered in quotes a SQL error will be generated .For Example :

In case of strings : "Jan","Feb","Mar" etc.

In case of numbers : 10,20,30

For more details refer to SQL IN documentation.

Null & Is Not Null No explanation is required
Note : In all the above cases NOT is the negative of the same operator