Progress
Programming
Handbook


Defining a Read-only Browse

You can browse database records by defining a browse widget for the query and opening the query. This is known as a read-only browse. Once the user finds and selects a record, your application uses the selected record, which the associated query puts in the associated buffer or buffers. The following code example illustrates a simple read-only browse for the customer table:

p-br01.p
DEFINE QUERY q1 FOR customer SCROLLING. 
DEFINE BROWSE b1 QUERY q1 DISPLAY cust-num name credit-limit balance 
    WITH 10 DOWN TITLE "Update Credit Limits". 
DEFINE FRAME f1 
    b1 
        WITH SIDE-LABELS ROW 2 CENTERED NO-BOX.  
OPEN QUERY q1 FOR EACH customer NO-LOCK. 
ENABLE ALL WITH FRAME f1. 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

When you run this example, the following browse appears:

The DOWN option of the DEFINE BROWSE statement tells Progress how many rows to display. If the TITLE option is not used, then the title bar above the column labels does not appear.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095