As should be expected, you are also able to design, edit, and run queries through PgAccess. Click on the Queries tab to view a list of the defined queries associated with your database. This area of the program should be familiar to Microsoft Access users, as the visual query designer and other features are are very similar to their counteraparts within that program.

As with the same buttons on other tabs, the New button will create a new query object and walk you through designing it. The Design button will display different properties of a specific query and allow you to modify them; note that this will, of course, only work for objects that have already been created. And Open opens query objects.

When creating a new query you can either design it manually by entering the definition into the query definition box (and any comments you may want to include), or you can use the visual query designer to speed up the process. Access it by clicking on the Visual designer button. As stated before, the interface to this tool is similar to the query designer tool in Microsoft Access. You are given a blank canvas to work with; add tables to the canvas by typing in the name of the table and hitting enter. You can also add tables by clicking the downward arrow button and selecting the table you wish to add from a list of available tables.

Once you've added the tables you wish to use, you can form links between them by clicking and dragging on a field, then pulling it from one table object to the other. When a link is formed it will display as a tendril-like line that connects the two objects together. Also note that you can move table objects around the canvas and the link graphic will stretch to fit whatever arrangement you desire. You may also delete tables from the canvas by clicking on their labels and then hitting the "delete" key on your keyboard.

Figure 4-4.

To select fields fields that you wish to be included in the results of the query, drag the field name down into the result zone (the cell-divided area at the bottom of the screen). You may also define conditions you wish to be applied to results from the query; do this by entering a condition into the "Criteria" field.

Once your query is saved you can access the results by opening the Query tab, then selecting your query from the list and clicking Open .