# EsbLROUpdateObject

Description

EsbLROUpdateObject() stores an updated version of a linked object on the server.

Syntax

    EsbLROUpdateObject (hCtx, pLinkId, usOption, pLRODesc)

    ByVal hCtx     As Long
          pLinkId  As ESB_LROHANDLE_API_T
    ByVal usOption As Integer
          pLRODesc As ESB_LRODESC_API_T

Parameters

hCtx | Essbase API context handle.
pLinkId | Object identification structure.
usOption | Option specifying which part of the object to update. Use one of the following: ESB_LRO_BOTH_API to update both the object's file and catalog entry. ESB_LRO_OBJ_API to update only the object's file. ESB_LRO_CATALOG_API to update only the object's catalog entry.
pLRODesc | Object's description structure, ESB_LRODESC_API_T.

Return Value

If successful, returns ESB_STS_NOERR. Otherwise, returns an error code.

Notes

- Essbase assigns the link ID when you create an object and stores it in the object's catalog entry. Use EsbLROGetCatalog() to retrieve the catalog entry contained in the description structure, ESB_LRODESC_API_T. You can then modify the description structure and call EsbLROUpdateObject() to save your changes on the server.
- Specify the usOption parameter as follows:
  - If the object is a cell note, use ESB_LRO_CATALOG_API. Cell notes are stored in the catalog entry.
  - If the object is a file, use ESB_LRO_BOTH_API to update both the file contents and the catalog.
  - If you only want to update the catalog information (such as the object description or user name), use ESB_LRO_CATALOG.API. In this case, the file contents are not updated.
  - If you only want to update the file contents and not the catalog, use ESB_LRO_OBJ_API. In this case, only the file contents and modification date are updated.
- The linked object can be any of the following types:
  - A flat file, such as a Word document, Excel spreadsheet, or bitmap image.
  - A cell note containing up to 599 characters of text.
  - A link to another Essbase database (linked partitions feature).

Access

A call to this function requires write privileges (ESB_PRIV_WRITE) to the data cell or the active database.

Example

    Declare Function EsbLROUpdateObject Lib "esbapin" _
    (ByVal hCtx As Long, pLinkID As ESB_LROHANDLE_API_T, _
    ByVal usOption As Integer, _
    pLRODesc As ESB_LRODESC_API_T) As Long

    Public Sub ESB_LROUpdateObject()

       Dim LinkID As ESB_LROHANDLE_API_T
       Dim Desc As ESB_LRODESC_API_T
       Dim opt As Integer

       LinkID.hObject = 1
       LinkID.cellKey.cellOffset = 0
       LinkID.cellKey.blkOffset = 198
       LinkID.cellKey.segment = 0

       Desc.userName = "admin"
       Desc.ObjType = ESB_LROTYPE_CELLNOTE_API
       Desc.note = "New Note from DFS"
       opt = ESB_STORE_OBJECT_API

       sts = EsbLROUpdateObject(hCtx, LinkID, _
                                opt, Desc)

    End Sub

See Also

LRO Constant and Structure Definitions
EsbLROGetObject()
EsbLROAddObject()
EsbLRODeleteObject()