# EsbUpdateFile

Description

EsbUpdateFile() sends an update specification to the active database from a file. The update data can either be stored in the database, or just verified and any errors returned. Also, any data blocks locked for update can be unlocked by this call.

Syntax

    EsbUpdateFile (hDestCtx, hSrcCtx, AppName, DbName, FileName, isStore, isUnlock)

    ByVal hDestCtx As Long
    ByVal hSrcCtx  As Long
    ByVal AppName  As String
    ByVal DbName   As String
    ByVal FileName As String
    ByVal isStore  As Integer
    ByVal isUnlock As Integer

Parameters

hDestCtx | Essbase VB API context handle of a target database on the server.
hSrcCtx | Essbase VB API context handle for the update file location. The report file can reside on the client or on the same server as the target database.
AppName | Application name for the update file location.
DbName | Database name for the update file location.
FileName | Name of the update specification file.
isStore | Controls storage of data. If TRUE, data is stored in the server; if FALSE, no data is stored.
isUnlock | Controls unlocking of data blocks. If TRUE, all relevant blocks which are locked will be unlocked (after data is stored, if necessary). If FALSE, no blocks are unlocked.

Return Value

None.

Notes

- If this function causes data to be stored (Store flag is TRUE), the relevant data blocks must previously have been locked for update (e.g. by calling EsbReport() with the Lock flag set to TRUE).
- If both the Store and Unlock flags are set to FALSE, the database merely performs a syntax check of the update specification.

Access

This function requires the caller to have write privilege (ESB_PRIV_WRITE) to the active database.

Example

    Declare Function EsbUpdateFile Lib "ESBAPIW" (ByVal hDestCtx As Long, ByVal hSrcCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal FileName As String, ByVal Store As Integer, ByVal Unlock As Integer) As Long

    Sub ESB_UpdateFile ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim FileName As String
       Dim Store As Integer
       Dim pUnlock As Integer
       Dim hSrcCtx As Long

       AppName = "Sample"
       DbName = "Basic"

       '***************************************
       ' Update file is an object at the server *
       '***************************************
       hSrcCtx = hCtx
       FileName = "update"

       Store = ESB_YES
       pUnlock = ESB_NO

       '************
       ' Update File
       '************
       sts = EsbUpdateFile (hCtx, hSrcCtx, AppName,
             DbName, FileName, Store, pUnlock)
    End Sub

See Also

EsbBeginUpdate()
EsbReportFile()
EsbUpdate()