EsbImport() allows importing data from different sources to the Essbase server.
EsbImport (hCtx, pRules, pData, User, ErrName, isAbortOnError)
ByVal hCtx As Long
pRules As ESB_OBJDEF_T
pData As ESB_OBJDEF_T
User As ESB_MBRUSER_T
ByVal ErrName As String
ByVal isAbortOnError As Integer
| hCtx | Essbase VB API context handle. |
| pRules | Pointer to the rules file object definition structure. |
| pData | Pointer to the data file object definition structure. |
| User | Pointer to the SQL user structure (if data source is a SQL database). A NULL SQL user structure indicates a non SQL data source. |
| ErrName | Name of the error output file to be created locally. |
| isAbortOnError | If TRUE import stops on the first error otherwise continues. |
Declare Function EsbImport Lib "ESBAPIW" (ByVal hCtx As Long, Rules As ESB_OBJDEF_T,
Data As ESB_OBJDEF_T, User As ESB_MBRUSER_T,
ByVal ErrName As String, ByVal AbortOnError As Integer)
As Long
Sub ESB_Import ()
Dim sts As Long
Dim Rules As ESB_OBJDEF_T
Dim Data As ESB_OBJDEF_T
Dim User As ESB_MBRUSER_T
Dim ErrorName As String
Dim AbortOnError As Integer
'*********************************
' Rules file resides at the server
'*********************************
Rules.hCtx = hCtx
Rules.Type = ESB_OBJTYPE_RULES
Rules.AppName = "Demo"
Rules.DbName = "Basic"
Rules.FileName = "Test"
'********************************
' Data file resides at the server
'********************************
Data.hCtx = hCtx
Data.Type = ESB_OBJTYPE_TEXT
Data.AppName = "Demo"
Data.DbName = "Basic"
Data.FileName = "Data"
'********************************
' Specify file to redirect errors
' to if any
'********************************
ErrorName = "IMPORT.ERR"
'*************************
' Abort on the first error
'*************************
AbortOnError = ESB_YES
'*******
' Import
'*******
sts = EsbImport (hCtx, Rules, Data, User, ErrorName, AbortOnError)
'**********************************************************************
'*
'* When a SQL data source is defined in the rules file, define
'* the variables in the ESB_OBJDEF_T Data structure as follows:
'* Data.hCtx = hCtx
'* Data.AppName = ""
'* Data.DbName = ""
'* Data.ObjType = ESB_OBJTYPE_NONE
'* Data.FileName = ""
'*
'* Also, provide strings for the variables in the ESB_MBRUSER_T
'* User structure; for example:
'* User.User = "Dbusernm"
'* User.Password = "Dbpasswd"
'*
'* Use a blank string for User and Password, if the SQL source
'* does not require user and password information; for example:
'* User.User = ""
'* User.Password = ""
'*
'* Call the function as follows:
'* sts = EsbImport (hCtx, Rules, Data, User, AbortOnError)
'*
'***********************************************************************
End Sub
EsbExport()