Browse Mode

With DB-Library for Visual Basic browse mode, your application can browse through database rows and update their values one row at a time. Each row must be transferred from the database into program variables before it can be browsed and updated. As a result, browsing involves several steps.

Because a row being browsed is not the actual row residing in the database but a copy residing in program variables, changes to the values in those variables must be transferred reliably to ensure that the original database row is kept up to date. In particular in multiuser situations, updates made to the database by one user must not incorrectly overwrite updates made by another user. Regulating updating is especially important because an application typically selects a number of rows from the database at once, but users browse and update the database one row at a time. A timestamp column in browsable database tables provides the information necessary to regulate multiuser updating.

Browse-mode functions also allow an application to handle ad hoc queries. Several browse-mode functions return information that an application can use to examine the structure of a complicated ad hoc query.

    To implement the DB-Library for Visual Basic browse mode in an application
  1. Execute a SELECT statement, generating result rows containing result columns. The SELECT statement must include the for browse option.
  2. Copy the values in the result column into the program variables one row at a time.
  3. If appropriate, change the variables' values in response to user input.
  4. If appropriate, execute an UPDATE statement that updates the database row corresponding to the current result row. To handle multiuser updates, the WHERE clause of the UPDATE statement must refer to the timestamp column. You can obtain a WHERE clause with the SqlQual$ function.
  5. Repeat steps 2 through 4 for each result row.

To use browse mode, the following conditions must be true:

In addition to these conditions, the browse mode always requires two connections ¾ one for selecting the data and another for performing updates based on the selected data.