Data Access Getting Started > Additional Features > Using Query Mode
 
Using Query Mode
You are now going to use query mode to display those employees whose employee number is less than 5 and whose manager is Thomasson, or whose employee number is greater than or equal 8 and whose manager starts with the letter T.
1. Click the Selection button in the Main window. Drag a DbNavigator gadget from the Data Access palette of the Palettes panel to the Gadgets buffer. Connect it to the EMPMGR_DS data source using the DbNavigator inspector.
2. You want your DbNavigator gadget to have the following buttons: Current Position, Number of Lines, Validate, Cancel, and Query Mode. Use the settings as shown in the following DbNavigator inspector to modify the DbNavigator gadget:
3. Click Apply in the DbNavigator inspector.
4. Click the Active button in the Main window. Click the table gadget. Press the F9 key to refresh the data source. All data source data are displayed.
The Main window now looks like this:
5. While in Active mode, click the button of the DbNavigator gadget to switch to query mode.
The data source substitutes a memory table for the SQL table. This memory table has the same number of columns as the SQL table, but it differs in that all columns in the memory table have a String type.
6. In the table gadget in the Main window, do the following:
*On the first line, type < 5 in the EMPNO column and Thomasson in the MANAGER column to list only those employees whose employee number is less than 5 and whose manager is Thomasson.
*On the second line, type >= 8 in the EMPNO column and LIKE ‘T%’ in the MANAGER column to list only those employees whose employee number is greater than or equal to 8 and whose manager starts with the letter T.
7. Click the button of the DbNavigator gadget to apply the query.
The table gadget displays only employees whose employee number is less than 5 and whose manager is Thomasson, or whose employee number is greater than or equal to 8 and whose manager starts with the letter T.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.