EsbRemoveLocks

Description

EsbRemoveLocks() removes all data block locks on a Database which are currently held by a user.

Syntax
EsbRemoveLocks (hCtx, AppName, DbName, LoginId)
ByVal hCtx    As Long
ByVal AppName As String
ByVal DbName  As String
ByVal LoginId As Long

Parameters

hCtxEssbase VB API context handle.
AppNameApplication name.
DbNameDatabase name.
LoginIdid of user login whose locks are to be removed.

Return Value

None.

Notes

Access

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

Example

Declare Function EsbRemoveLocks Lib "ESBAPIW" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal LoginId As Long) As Long 

Sub ESB_RemoveLocks ()
   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)
   '*****************
   ' Remove all locks
   '*****************
   For n = 1 To Items
     '*******************************
     ' Get next user lock structure 
     ' from the list and remove locks
     '*******************************
     sts = EsbGetNextItem (hCtx, 
           ESB_LOCKINFO_TYPE, LockInfo)
     sts = EsbRemoveLocks (hCtx, AppName,
           DbName, LockInfo.LoginId)
   Next
End Sub

See Also

EsbListLocks()