# EsbLockObject

Description

EsbLockObject() locks an object on the server or client object system to prevent other users from updating it.

Syntax

    EsbLockObject (hCtx, ObjType, AppName, DbName, ObjName)

    ByVal hCtx    As Long
    ByVal ObjType As Long
    ByVal AppName As String
    ByVal DbName  As String
    ByVal ObjName As String

Parameters

hCtx | Essbase VB API context handle. May be local context handle returned by EsbCreateLocalContext().
ObjType | Object type (must be single type. Refer to Bitmask Data Types for a list of possible values.
AppName | Application name.
DbName | Database name. If an empty string, uses the application sub-directory.
ObjName | Name of an object to lock.

Return Value

None.

Notes

- To lock an object, the object must already exist and not be locked by another user.
- This function does not retrieve the object. To retrieve the object, use EsbGetObject().

Access

This function requires the caller to have Application or Database Design privilege (ESB_PRIV_APPDESIGN or ESB_PRIV_DBDESIGN) for the specified application or database containing the object.

Example

    Declare Function EsbLockObject Lib "ESBAPIW" (ByVal hCtx As Long, ByVal ObjType As Integer, ByVal AppName As String, ByVal DbName As String, ByVal ObjName As String) As Long

    Sub ESB_LockObject ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim ObjName As String
       Dim ObjType As Integer

       AppName = "Sample"
       DbName = "Basic"
       ObjName = "Basic"
       ObjType = ESB_OBJTYPE_OUTLINE

       '******************
       ' Lock Rules Object
       '******************
       sts = EsbLockObject (hCtx, ObjType, AppName,
             DbName, ObjName)
    End Sub

See Also

EsbGetObject()
EsbGetObjectInfo()
EsbListObjects()
EsbPutObject()
EsbUnlockObject()