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
| Parameter | Description |
|---|---|
hCtx | VB API context handle. |
AppName | Application name. |
DbName | Database name. |
LoginId | id of user login whose locks are to be removed. |
Notes
The required LoginId can be obtained from the user lock info structure returned by the EsbListLocks function.
EssRemoveLocks() terminates the connection of the user specified by LoginId if that user is currently logged in.
Return Value
None.
Access
This function requires the caller to have Database Design privilege (ESB_PRIV_DBDESIGN) for the specified database.
Example
Declare Function EsbRemoveLocks Lib "ESBAPIN" (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 SubSee Also