Your full service technology partner! 
-Collapse +Expand
Search Paradox Group:

-Collapse +Expand Paradox To/From
-Collapse +Expand Paradox Store

Prestwood eMagazine

December Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...   Print This     
  From the January 2015 Issue of Prestwood eMag
Paradox ObjectPAL Coding:
How to Make Programmed Paradox Queries with Microsoft Notepad
Posted 6 years ago on 12/15/2014 and updated 11/28/2020
Take Away:

This article discusses a technique I use to create ObjectPAL queries that can easily be modified for other purposes such as customized reporting.



Everyone knows how useful Paradox queries can be for extracting data in a variety of ways. Many people who use this versatile database software package know how to make all kinds of queries. But what if you want to take the queries you already have to the next level and weave them into an ObjectPAL programming task without a lot of hassle? I will discuss a technique I use for doing this and it’s much easier than you think!


You need to go into Paradox and right click the query you want the programming for. Next, click “Edit” on the pop up menu and you should see the query’s underlying code in the Microsoft Notepad application found on all Windows computers. Here is what the code for a query looks like after following these steps:

  1. Query  
  4.                                    | Check         | Check             | Check            |  
  6.                                    | Check         | Check        | Check      |  
  7. EndQuery

The next step is to block or highlight the main part of the query programming, excluding the Query and EndQuery portions. Then copy it using Edit then Copy from Microsoft Notepad’s menu bar or the CONTROL C key combination.


Now you need to paste the copied selection of software from the query into your ObjectPAL Paradox routine. Position your cursor at the location in the ObjectPAL code where you want the query to execute and then use the CONTROL V key combination to paste the code. See the sample code below:

  1. qVar = Query  
  3.                                    | Check         | Check              | Check             |           
  5.                                    | Check         | Check        | Check      |  
  6. EndQuery  
  7. executeQBE(‘:CUSTOMER:GenericQuery.db’)  
  8. ifopen(‘:CUSTOMER:TemporaryTable.db’) And‘:CUSTOMER:GenericQuery.db’) then  
  9. emptyempty()  
  10. edit()  
  11. whileNOT tc2.eot()  
  12. (Further processing code goes here)  
  13. nextRecord()  
  14. endWhile  
  15. endif
  16. endEdit()  
  17. close()  
  18. close() 

The above ObjectPAL code shows how I inserted the main code from the query into an ObjectPAL pushbutton event in a Paradox form. At this point, feel free to modify the programmed query by adding more result fields and filtering criteria.

Notice the query is preceded by qVar = Query and followed by EndQuery. qVar is an ObjectPAL query object used to programmatically execute the query. The results are then stored in the GenericQuery data table in the folder represented by the CUSTOMER alias via the ObjectPAL directive, qVar.executeQBE.

Next, the GenericQuery data table is used in conjunction with Tcursor objects tc and tc2 to perform more specialized operations with the results of the executed query.


The ObjectPAL queries are excellent vehicles for performing large data extraction operations, because they run much more quickly than by trying to do the same thing with Tcursors. Specific chores that queries by themselves may not be well suited for can be handled by Tcursor objects. Integrating the underlying code of a query into an ObjectPAL custom software task is the best approach. Most people don’t like to wait prolonged periods of time for code to process large blocks of data. ObjectPAL queries are instrumental in helping you overcome this issue.


Share a thought or comment...
Comment 1 of 1

That's true, I was just saying that NOTEPAD is a quick, easy veicle for transferring the QBE code to an OBJECTPAL script under one of object explorer's events within the FSL form. The aliases in the code from NOTEPAD reference the already set up data tables to be used in the query.

Posted 45 months ago
Write a Comment...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P113A1
Enter key:
Article Contributed By NE Ohio Computer Guy:

Please visit my software developer website for more information about my services. I offer application development as well as Android app coding services. My developer skills are best suited to dealing with custom software projects. I can perform programming for Corel Paradox as well as C# and PHP.

In my local area of northeast Ohio, I can cater to computer repair and "fix my computer" issues. And don‘t forget to check out my YouTube Channel. It is full of cool videos and has something for everyone!

Use my contact web page today to reach me about any software design ideas you have.

Visit Profile

 KB Article #102710 Counter
Since 12/15/2014
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site:

©1995-2020 Prestwood IT Solutions.   [Security & Privacy]