Open Source – Query By Example

qbe

The Query by Example class provide a method of allow end users to filter their data using a simple QBE interface. It allows the them to save thier queries for later reuse as well.

A QBE are three basic modes of QBE HFitler, SQL, and Advanced SQL. Hfilter and SQL work very similarly except one is accomplishing the task via Hfilter, and one uses an SQL statement with HExecuteSQLQuery. The one advantage to the SQL method is the Multiple File Fields will be expose to the QBE interface See the special notes section for additional information.

The Advanced SQL method allows complete control of the SQL statement. This requires a table that is set to be filled by programming. With the Advanced SQL mode the data can be fully loaded on initialization or using a Timer function so that the user is able to interact with the browse while records are still loading.

The QBE class was original inspired and some of the base code comes from the training material provided by Glenn Rathke of Software Design Consulting. We highly recommend his training materials to anyone using the WX suite of tools. Soft Design Consulting, LLC is dedicated to providing the best training in WinDev, WebDev, andWinDev Mobile, and that means we bring numerous years of creating course content and presentation to the WinDev community.

Glenn Rathke, owner of Soft Design Consulting is a seasoned developer and former professor at Roosevelt University in Chicago, IL. Glenn has trained hundreds of developers and students over the years. He incorporates concepts from many proven programming courses as well as his own unique ‘take’ on the WinDev language.
Soft Design Consulting provides and teaches:

1. Elegantly simple user interface which shortens the end user learning curve.
2. Data access across all methods; tables, HFilter, Queries, HExecuteSQLQuery, Stored Procedures, and more…
3. Fast data access which increases productivity.
4. Reusable QBE
5. Implementation of Dynamic Business Rules

Training is available as self study courses which include Our unique real world examples, manual, and streaming videos. We also offer 4 days of on-site training at your facility as well in the St. Louis area. More info can be found at www.sdcdev.net

Enough of a sales job. I hope you enjoy it. If you have any questions, suggestions, complaints (well not complaints) then please use the comments below so we can all benefit from each others additions. This article will be updated with each new release of the class.

If you have any questions about the NextAge Open Source initiative be sure to check out this post.

The Download Links

Documentation in PDF format

Class and Documentation in a Zip File

Demo App with example code for all NextAge Open Source Class plus other bits and pieces

 

Code Bricks

Change Log

1.0 – January 9, 2013

Initial Release

1.01 – January 16 , 2013

1. Fixed direct reference to file in DeleteSavedQuery Method
2. Added some methods used by Browse Form Manager to refresh the table after an update.

[suffusion-the-author display=’author’]

Pete Halsted[suffusion-the-author display=’description’]

 

7 thoughts on “Open Source – Query By Example

  1. SOOOO excited to integrate this QBE into my WD17 apps; I love Glenn’s training courses and you’ve blown me away by not only your detailed knowledge of WD but also your generosity to the WD community. WD’s lack of an easy QBE module has held me back for years; this is HUGE!!!!

    Like

  2. Hi Pete.

    I didn’t really if this class can be of help, so i downloaded the example to figure it out.

    But there is no project file anywhere, and when I create a new one and add all the elements (2 wdw, 3 wdt and 2 wdc) then I get two compilation errors:

    Error:The identifier ‘QBEFieldValue’ is unknown or inaccessible.
    QueryByExample.LoadSavedQuery, Local Procedure, line 14, column 6

    and 45 GUI erros (due to invalid paths to PNG files)

    Regards.

    José Antonio Garrido.

    Like

  3. Correct Jose this is not a project just the elements to incorporate into your project. If you follow the instructions in the documentation and add the file described to your analysis then you will not get that error in the LoadSavedQuery Method, It should be using indirection for that call, and has been fixed in 1.01 that will be released by this weekend. But as long as you add the files described with the same file and field names it will work as is, the indirection is only needed if you use different file or field names and the special properties.

    There is nothing special about the PNG files as soon as you reskin the control templates to match your project, 90% of those errors go away. Then there will be a few icons for the buttons that you should change to what ever icons match your theme.

    Once you do all of that a few Compile errors will still show in the project, but they are not “real” The control templates make calls to class methods, and the class has to be defined on the window. So therefore it shows a compile error on the control template because QBE doesn’t exist. You can right click and tell it to disable those errors, or just ignore them, they are not real errors, because the control template is never used on its own. I feel it is an oversight on pcSoft’s side and there should be some feature or option or something that doesn’t show errors in control templates as compile errors.

    I will be release a demo application that includes all of the open source classes by this weekend. That will be a full project will everything ready to run.

    Like

  4. Well, I look throught it again, but if you will be making a complete project with it, then I will wait.

    Regards.

    José Antonio Garrido.

    Like

  5. A few issues with Saved Queries has been brought to my attention, the code is fixed and being tested and will be released shortly.

    Like

    1. The open source project includes examples and documentation for the QBE. If you need assistance beyond that, I offer one on one training and mentoring services. We could do a remote session where I help to integrate it into your project. If you would like more information or my rates, please contact me at pete@thenextage.com.

      Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s