# EsbListUsers

Description

EsbListUsers() lists all users who have access to a particular Essbase server, application or database.

Syntax

    EsbListUsers (hCtx, AppName, DbName, pItems)

    ByVal hCtx    As Long
    ByVal AppName As String
    ByVal DbName  As String
          pItems  As Integer

Parameters

hCtx | Essbase VB API context handle
AppName | Application name. If an empty string, lists all users
DbName | Database name.
pItems | Address of variable to receive count of users

Return Value

If successful, returns a count of the number of users in pCount, and generates a list of users with access to the specified application and database that is accessible via EsbGetNextItem().

Notes

- If both AppName and DbName are not empty strings, only users with access to the specified application and database will be listed. If DbName is an empty string, only users with access to the specified application will be listed. If AppName is an empty string, all users that exist on the server will be listed.
- The list of users with access to the specified application and database--which is accessible via EsbGetNextItem()--is returned as a list of ESB_USERINFO_T structures. The AppName and DbName fields of these returned user info structures contain NULL values.

Access

This function requires no special privileges.

Example

    Declare Function EsbListUsers Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, Count As Integer) As Long

    Sub ESB_ListUsers ()
       Dim Count As Integer
       Dim AppName As String
       Dim DbName As String
       Dim UserInfo As ESB_USERINFO_T
       Dim sts As Long

       AppName = "Sample"
       DbName = "Basic"

       '***********
       ' List Users
       '***********
       sts = EsbListUsers (hCtx, AppName, DbName,
             Count)

       For n = 1 To Count

         '*****************************
         ' Get next User Info structure
         ' from the list
         '*****************************
         sts = EsbGetNextItem (hCtx,
               ESB_USERINFO_TYPE, UserInfo)
       Next
    End Sub

See Also

EsbGetUser()
EsbListConnections()
EsbListGroups()
EsbListLocks()
EsbGetNextItem()