LockRsc

ACCPAC Common Controls

AccpacMultiuser.LockRsc

Locks a resource as shared (read lock) or exclusive (write lock).

Function LockRsc(
  Resource As String,
  Exclusive As Boolean) As tagMultiuserStatus

Parameters

Resource

[in] name of the resource to lock

Exclusive

[in] flag indicating whether to place an exclusive (TRUE) or shared (FALSE) lock on the resource

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.

Unlike LockApp and LockOrg, to upgrade (from shared to exclusive) or downgrade (from exclusive to shared) an existing lock on the resource, you can call LockRsc with the appropriate value for Exclusive (TRUE to upgrade, FALSE to downgrade) without first having to call UnlockRsc.

To unlock the resource, use UnlockRsc.