Progress
DataServer
for ODBC Guide


DEFINE BROWSE Statement

The DEFINE BROWSE statement relies on a unique record identifier for forward and backward scrolling. If your ODBC data-source table does not support the Progress ROWID function (through either a PROGRESS_RECID column or an indexed NUMBER column with unique values), you can write code that explicitly requests the default Progress browse scrolling behavior, similar to this:

DEFINE QUERY q FOR customer FIELDS (cust-num name address) SCROLLING.
DEFINE BROWSE b QUERY q DISPLAY cust-num name address with 10 down.
DEFINE BUTTON upd.
OPEN QUERY q FOR EACH customer.
ENABLE upd b WITH FRAME x.
ON CHOOSE OF upd DO:
  DEFINE VAR n as INT.
  n = CURRENT-RESULT-ROW("q").
  GET PREV q.
  GET NEXT q EXCLUSIVE-LOCK.
  IF CURRENT-RESULT-ROW("q") = n THEN
    UPDATE customer.address WITH FRAME z VIEW-AS DIALOG-BOX.
    /* else, indicate that an error occurred: the record was deleted in
    the meantime. */
    DISPLAY address WITH BROWSE b.
  END.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 


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