AccpacMultiuser.LockOrg
Locks an organization's database as shared (read lock) or exclusive (write lock).
Function LockOrg(
OrgID As String,
Exclusive As Boolean) As tagMultiuserStatus
Parameters
OrgID
[in] the organization (database) ID of the database to be locked
Exclusive
[in] flag indicating whether to place an exclusive (TRUE) or shared (FALSE) lock on the organization's database
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 organization's database as "shared", if required, so there's no need to explicitly lock the organization's database as "shared."
Call LockOrg only when the organization's database isn't currently locked by a previous call to LockOrg. To upgrade (from shared to exclusive) or downgrade (from exclusive to shared) a program's existing lock on the organization's database, use RegradeOrg. To unlock the organization's database, use UnlockOrg.