# EsbSetDefaultCalcFile

Description

EsbSetDefaultCalcFile() sets the default calc script for the active database from a calc script file.

Syntax

    EsbSetDefaultCalcFile (hDestCtx, hSrcCtx, AppName, DbName, FileName)

    ByVal hDestCtx As Long
    ByVal hSrcCtx  As Long
    ByVal AppName  As String
    ByVal DbName   As String
    ByVal FileName As String

Parameters

hDestCtx | Essbase VB API context handle of a target database on the server.
hSrcCtx | Essbase VB API context handle for the calc script file location. The calc script file can reside on the client or on the same server as the target database.
AppName | Application name for the calc script file location.
DbName | Database name for the calc script file location.
FileName | Name of the default calc script file.

Return Value

None.

Notes

- The default calc script must not be greater than 64 KBytes long.

Access

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

Example

    Declare Function EsbSetDefaultCalcFile Lib "ESBAPIW" (ByVal hDestCtx As Long, ByVal hSrcCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal FileName As String) As Long

    Sub ESB_SetDefaultCalcFile ()
       Dim sts As Long
       Dim AppName As String
       Dim DbName As String
       Dim FileName As String
       Dim hSrcCtx As Long

       AppName = "Sample"
       DbName = "Basic"

       '***************************************
       ' Calc script is an object at the server *
       '***************************************
       hSrcCtx = hCtx
       FileName = "calc"

       '**********
       ' Calc File
       '**********
       sts = EsbSetDefaultCalcFile (hCtx, hSrcCtx, AppName, DbName, FileName)
    End Sub

See Also

EsbDefaultCalc()
EsbGetDefaultCalc()
EsbSetDefaultCalc()