EsbExport

Exports a database to an ASCII file.

Syntax

EsbExport (hCtx, AppName, DbName, FilePath, Level, isColumns)
ByVal hCtx      As Long
ByVal AppName   As String
ByVal DbName    As String
ByVal FilePath  As String
ByVal Level     As Integer
ByVal isColumns As Integer
ParameterDescription

hCtx

VB API context handle.

AppName

Name of application to archive.

DbName

Name of database to archive.

FilePath

Full path name of server file to contain archive information.

Level

Controls level of data to export. Should be one of:

  • ESB_DATA_ALL - export all levels of data

  • ESB_DATA_LEVEL0 - only export all data from level zero blocks

  • ESB_DATA_INPUT - only export data from input level blocks

isColumns

Controls output of data blocks in column format.

Notes

If this function succeeds, the export 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.

Return Value

None.

Access

This function requires callers to have access to the database, and to have selected it as their active database using EsbSetActive().

Example

Declare Function EsbExport Lib "ESBAPIN" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal FilePath As String, ByVal Level As Integer, ByVal Columns As Integer) As Long

Sub ESB_Export ()
   Dim sts As Long
   Dim AppName As String 
   Dim DbName As String
   Dim PathName As String
   Dim Level As Integer
   Dim Columns As Integer
   Dim ProcState As ESB_PROCSTATE_T    AppName = "Sample"
   DbName = "Basic"
   PathName = "c:\essbase\main.txt"
   Level = ESB_DATA_INPUT
   Columns = ESB_YES
   '******************************
   ' Export input level data only
   '******************************
   sts = EsbExport (hCtx, AppName, DbName,
   PathName, Level, Columns) 
   '************************************
   ' 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

  • EsbImport