LockApp

ACCPAC Common Controls

AccpacMultiuser.LockApp

Locks an application's data as shared (read lock) or exclusive (write lock).

Function LockApp(
  OrgID As String,
  AppID As String,
  Exclusive As Boolean) As tagMultiuserStatus

Parameters

OrgID

[in] the organization (database) ID of the company

AppID

[in] the two-letter application ID of the application whose data is to be locked

Exclusive

[in] flag indicating whether to place an exclusive (TRUE) or shared (FALSE) lock on the application's data

Return Value

Returns the status of the call.

Remarks

If possible, avoid using this method. Locking should be done by views rather than by UIs. Locking (by the UI or macro) is especially dangerous when ACCPAC is running remotely over the Internet. When a view opens, it automatically locks the application's data as "shared", if required, so there's no need to explicitly lock the application's data as "shared."

Call LockApp only when the application's data isn't currently locked by a previous call to LockApp. To upgrade (from shared to exclusive) or downgrade (from exclusive to shared) a program's existing lock on the application's data, use RegradeApp. To unlock the application's data, use UnlockApp.