EsbCalc

Sends and optionally executes a calc script against the active database as a single string. This function is equivalent to making a call to EsbBeginCalc, followed by calls to EsbSendString(), and finally to EsbEndCalc(). The calculation can either be initiated, or the calc script can just be verified and any errors returned.

Syntax

EsbCalc (hCtx, isCalculate, cscQuery)
ByVal hCtx        As Long
ByVal isCalculate As Integer
ByVal cscQuery    As String
ParameterDescription

hCtx

VB API context handle.

isCalculate

Controls calculation of the calc script. If TRUE, the calc script is executed.

cscQuery

The calc script, as a single string (must be less than 64 KB).

Notes

Return Value

None.

Access

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

Example

Declare Function EsbCalc Lib "ESBAPIN" (ByVal hCtx As Long, ByVal Calculate As Integer, ByVal Script As String) As Long

Sub ESB_Calc ()
   Dim sts As Long
   Dim Script As String 
   Dim Calculate As Integer
   Dim ProcState As ESB_PROCSTATE_T   Script = "CALC ALL;"
   Calculate = ESB_YES   '**********
   ' Calculate
   '**********
   sts = EsbCalc (hCtx, Calculate, Script)   '************************************
   ' 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