Advantage SQL Engine

Returns a result set containing all of the tables currently opened on the server by the specified user


EXECUTE PROCEDURE sp_mgGetUserTables( UserName,Character,200 )


UserName (I)

Name of the connected user or a NetWare connection number.

TableName (O)

Fully qualified table name

LockType (O)

Type of locking mode the table was opened with.

LockTypeValue (O)

Integer value of the lock type. This is the same value as is returned in the ADS_MGMT_TABLE_INFO structure by the AdsMgGetOpenTables API.


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. The returned table name is the fully qualified path of the table on the server. 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 '\'.

The LockType parameter returns the following values. The corresponding LockTypeValue is given in parentheses.

ADS (1) for Advantage Proprietary Locking,

CDX (2) for Advantage Compatibility Locking on a DBF/CDX file and,

NTX (3) for Advantage Compatibility Locking on a DBF/NTX file.

ADT (4) for Advantage Compatibility Locking on an ADT table opened by Advantage Local Server.

Note With Advantage Local Server, sp_mgGetUserTables will only return tables open by this user in the instance of Advantage Local Server currently loaded into memory. Information about tables the user has opened in other instances of the Advantage Local Server will not be returned.


EXECUTE PROCEDURE sp_mgGetUserTables( 'username' );

To retrieve table names using a NetWare connection number, enclose the connection number in quotes:

EXECUTE PROCEDURE sp_mgGetUserTables( '67' );


To retrieve table names using a computername and username combo, separate them with a backslash:

EXECUTE PROCEDURE sp_mgGetUserTables( 'workstation\username' )


Trailing backslash characters after the computer name are ignored:

EXECUTE PROCEDURE sp_mgGetUserTables( 'workstation\' )


See Also