Essbase VB API

Ну и напоследок пример того как можно использовать VisualBasic для доступа  к EssBase

Module Module1
Dim lngInstHndl As Long
Dim lngCtxHndl As Long
Dim lngStatus As Long
Structure ESB_INIT_T

Public Version As Long
Public MaxHandles As Integer
Public LocalPath As String
Public MessageFile As String
Public HelpFile As String
Public ClientError As Integer
Public ErrorStack As Integer
Public usApiType As Integer

End Structure

Declare Function EssLogin Lib ” essapinu.dll” (ByVal hInst As Long, ByVal Server As String, ByVal User As String, ByVal Password As String, pItems As Integer, hCtx As Long) As Long

Declare Function EssInit Lib “E: essapinu.dll” (ByRef pInit As ESB_INIT_T, ByRef phInst As Long) As Long

Sub Main()
Dim structInit As ESB_INIT_T
structInit.Version = &H93000
structInit.MaxHandles = 10
structInit.LocalPath = “products\Essbase\EssbaseServer\bin”
structInit.MessageFile = “”
structInit.ClientError = 1
structInit.ErrorStack = 100
lngStatus = EssInit(structInit, lngInstHndl)
If lngStatus = 0 Then
Console.WriteLine(“Init ! “)
Dim strServer As String
Dim strUser As String
Dim strPassword As String
Dim intNumAppDb As Integer

strServer = “127.0.0.1”
strUser = “admin”
strPassword = “password”

lngStatus = EssLogin(lngInstHndl, strServer, strUser, strPassword, intNumAppDb, lngCtxHndl)

If lngStatus = 0 Then
Console.WriteLine(“LogIN”)
Else
Console.WriteLine(lngStatus)
End If
Else
Console.WriteLine(lngStatus)
End If
Console.ReadLine()
End Sub

End Module