Type
Control Command

Purpose
The lock db command is only functional when using DataEase on a LAN (local area network). This command completely prohibits other users from accessing the current application.

Syntax
lock db .

Usage
The lock db command can be used to preserve the integrity of data during an extended Control procedure or to prevent a conflict when installing a new or revised application into the application.
The lock db Control command differs from the lock Processing command in several ways:
It locks the whole application rather than specified tables or individual records.
There is no shared option for the lock db command: no other user can view records or access any table in the application for any purpose.
The lock db command is not automatically terminated at the end of the procedure. Once a application is locked by the lock db command, it remains locked until an unlock db command is executed, or the user who initiated the lock db command exits from DataEase.
LAN
On a LAN (local area network), if another user is currently using any resource required by the lock db command, DataEase displays a Resource Conflict message. While this message is displayed, DataEase automatically tries to execute the command at brief intervals.
When the required resource becomes available, DataEase automatically resumes processing and executes the rest of the procedure. See the Record Entry chapter in the User's Guide for more information on resource conflicts and Multi-User Locking Options.

Example
lock db .
run procedure "CALCULATE DISCOUNT" .
run procedure "PRINT RESERVATIONS" .
unlock db .
This query tells DataEase: 1) Lock the current application. 2) Run the CALCULATE DISCOUNT procedure. 3) Run the PRINT RESERVATIONS procedure. 4) Unlock the application.