Advantage SQL Engine

Returns a result containing the record numbers of all records locked on the specified table by the specified user.


EXECUTE PROCEDURE sp_mgGetUserLocks( TableName,Character,255;

UserName,Character,200 )


TableName (I)

Fully qualified path to the table.

UserName (I)

Name of the connected user or a NetWare connection number.

LockedRecNo (O)

Record number of locked record.


The table name must be the fully qualified path to the table on the server. The user name can be the Advantage client’s computer name or a NetWare connection number if running against the Advantage Database Server for NetWare. If using a connection number, it must be enclosed in quotes. To be more specific with the user name parameter, the user name (client computer name) and the operating system user login name can be specified together (computer name first), separated by a backslash '\'.

Note With Advantage Local Server, sp_mgGetUserLocks will only return locks instantiated by the user in the instance of Advantage Local Server currently loaded into memory. Information about locks the user has instantiated in other instances of the Advantage Local Server will not be returned.


EXECUTE PROCEDURE sp_mgGetUserLocks( '\\server\share\data\table.adt', 'user' );


To retrieve user locks using a NetWare connection number, enclose the connection number in quotes:

EXECUTE PROCEDURE sp_mgGetUserLocks( '\\server\share\data\table.adt', '59' );


To retrieve user locks using a computername and username combo, separate them with a backslash:

EXECUTE PROCEDURE sp_mgGetUserLocks( 'workstation\username' )


Trailing backslash characters after the computer name are ignored:

EXECUTE PROCEDURE sp_mgGetUserLocks( 'workstation\' )


See Also