Consultor Eletrônico



Kbase P23241: Can the text of error "(Record) in use by (name) : Wait or c
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/04/2003
Status: Unverified

GOAL:

Can the text of error "(Record) in use by (name) : Wait or choose CANCEL to
stop. (2624)" Be captured programmatically?

FACT(s) (Environment):

Windows

FIX:

No, the only way to capture the name and number of the user locking a given record is through the use of the _lock and/or _Connect VST tables as per the following sample:

FIND FIRST customer EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
IF LOCKED(Customer) THEN DO:
DEFINE VARIABLE iRecid AS INTEGER NO-UNDO.
DEFINE VARIABLE iTableNum AS INTEGER NO-UNDO.

FIND FIRST customer NO-LOCK NO-ERROR.
ASSIGN
iRecid = RECID(Customer).

FIND FIRST _File WHERE _File._File-Name = "Customer" NO-LOCK.
ASSIGN
iTableNum = _File._File-Num.


FIND FIRST _Lock WHERE
_Lock._Lock-Recid = iRecid AND
_Lock._Lock-Table = iTableNum AND
_Lock._Lock-Flags = "X"
NO-LOCK.

MESSAGE
_Lock._Lock-Usr _Lock._Lock-Name
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.