# EsbListLocks

Description

EsbListLocks() lists all users who are connected to a specific application and database, together with a Items of data blocks which they currently have locked.

Syntax

    EsbListLocks (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.
DbName | Database name.
pItems | Address of variable to receive Items of users.

Return Value

If successful, returns a Items of the number of connected users in pItems, and generates a list of user lock structures accessible via EsbGetNextItem().

Notes

- This function is a "snapshot", in that only those users who are connected to the server when this function is called will be listed.

Access

This function requires the caller to have Database Design privilege (ESB_PRIV_DBDESIGN) for the specified database.

Example

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

    Sub ESB_ListLocks ()
       Dim Items As Integer
       Dim AppName As String
       Dim DbName As String
       Dim LockInfo As ESB_LOCKINFO_T
       Dim sts As Long

       AppName = "Sample"
       DbName = "Basic"

       '***********
       ' List Locks
       '***********
       sts = EsbListLocks (hCtx, AppName, DbName,
             Items)

       For n = 1 To Items

         '*****************************
         ' Get next user lock structure
         ' from the list
         '*****************************
         sts = EsbGetNextItem (hCtx,
               ESB_LOCKINFO_TYPE, LockInfo)
       Next
    End Sub

See Also

EsbListConnections()
EsbListUsers()
EsbRemoveLocks()
EsbGetNextItem()