# EsbDefaultCalc

Description

EsbDefaultCalc() executes the default calculation for the active database.

Syntax

    EsbDefaultCalc (hCtx)

    ByVal hCtx As Long

Parameters

hCtx | Essbase VB API context handle.

Return Value

None.

Notes

- If this function succeeds and the calculation is started, it will continue on the server as an asynchronous process after the return from this call. The caller should check at regular intervals to see if the process has completed by calling EsbGetProcessState() until it returns ESB_STATE_DONE.
- To get and set the default calc script, use the functions EsbGetDefaultCalc(), EsbSetDefaultCalc() and EsbSetDefaultCalcFile().

Access

This function requires the caller to have calc privilege (ESB_PRIV_CALC) to the active database.

Example

    Declare Function EsbDefaultCalc Lib "ESBAPIW" (ByVal hCtx As Long) As Long

    Sub ESB_DefaultCalc ()
       Dim sts As Long
       Dim ProcState As ESB_PROCSTATE_T

       '************************
       ' Run default calc script
       '************************
       sts = EsbDefaultCalc (hCtx)

       '************************************
       ' Check process state till it is done
       '************************************
       sts = EsbGetProcessState (hCtx, ProcState)
        Do Until ProcState.State = ESB_STATE_DONE
          sts = EsbGetProcessState (hCtx, ProcState)
       Loop
    End Sub

See Also

EsbBeginCalc()
EsbCalc()
EsbGetDefaultCalc()
EsbSetDefaultCalc()
EsbSetDefaultCalcFile()