skip to main content
OpenEdge Data Management: DataServer for ODBC
Programming Considerations : ABL issues : DEFINE BROWSE statement
 

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 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 browse scrolling behavior, similar to this:
DEFINE VARIABLE iRow AS INTEGER NO-UNDO.
DEFINE QUERY qCustomer FOR customer FIELDS (custnum name address) SCROLLING.
DEFINE BROWSE b QUERY qCustomer DISPLAY custnum name address WITH 10 DOWN.
DEFINE BUTTON upd.
OPEN QUERY qCustomer FOR EACH customer.
ENABLE upd b WITH FRAME x.
ON CHOOSE OF upd DO:
  iRow = CURRENT-RESULT-ROW("q").
GET PREV qCustomer.
GET NEXT qCustomer EXCLUSIVE-LOCK.
IF CURRENT-RESULT-ROW("qCustomer") = iRow 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 customer.address WITH BROWSE b.
END.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.