# EsbPutObject

Description

EsbPutObject() copies an object from a local file to the server or client object system, and optionally unlocks it.

Syntax

    EsbPutObject (hCtx, ObjType, AppName, DbName, ObjName, LocalName, isUnlock)

    ByVal hCtx      As Long
    ByVal ObjType   As Long
    ByVal AppName   As String
    ByVal DbName    As String
    ByVal ObjName   As String
    ByVal LocalName As String
    ByVal isUnlock  As Integer

Parameters

hCtx | Essbase VB API context handle. Can 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 put.
LocalName | Full path name of local source file on client.
isUnlock | Flag to control object unlocking. If TRUE, the server object is unlocked to allow updates by other users.

Return Value

If successful, the object is copied to the server from the local file specified by LocalName.

Notes

- In order to put an object which already exists on the server, it must have previously been locked by the caller. If the object does not already exist on the server, it will be created.

Access

This function requires the caller to have the appropriate level of access to the specified application and/or database to contain the object (depending on the object type). To unlock the object (unlock flag is TRUE), the caller must 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 EsbPutObject Lib "ESBAPIW" (ByVal hCtx As Long, ByVal ObjType As Integer, ByVal AppName As String, ByVal DbName As String, ByVal ObjName As String, ByVal LocalName As String, ByVal Unlock As Integer) As Long

    Sub ESB_PutObject ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim ObjName As String
       Dim ObjType As Integer
       Dim LocalName As String
       Dim Unlock As Integer

       AppName = "Sample"
       DbName = "Basic"
       ObjName = "Basic"
       ObjType = ESB_OBJTYPE_TEXT
       LocalName = "C:\ESSBASE\CLIENT\BASIC.TXT"
       Unlock = ESB_YES

       '***********
       ' Put Object
       '***********
       sts = EsbPutObject (hCtx, ObjType, AppName,
             DbName, ObjName, LocalName, Unlock)
    End Sub

See Also

EsbGetObject()
EsbLockObject()
EsbUnlockObject()
EsbListObjects()