IMetabase.GetConnectedUsers

Syntax

GetConnectedUsers: IConnectedUsersInfo;

Description

The GetConnectedUsers method enables getting information about the users that are connected to the repository.

Comments

The Oracle server should have the Select grant on the V_$SESSION view for the user who views or disconnects the users connected to the repository. This method is not implemented for PostgreSQL DBMS, use the GetConnectedUsersEx method.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Users: IConnectedUsersInfo;
    User: IConnectedUserInfo;
Begin
    MB := MetabaseClass.Active;
    Users := MB.GetConnectedUsers;
    For Each User In Users Do
        Debug.WriteLine("Workstation: " + User.HostName + "; MAC address: " + User.NETAddress);
        Debug.WriteLine("DBMS user: " + User.UserName + "; OS user: " + User.UserOsName);
    End For;
End Sub UserProc;

After executing the example the development environment console displays information about all users connected to the current repository.

See also:

IMetabase