I've been trying to get the TM1 API up and running for days without success.
There is a virtual server with TM1 10.2.2 running three TM1 databases (all with IntegratedSecurityMode 1 or 2). One of the databases is the SData sample database.
On the client side I use the Perspectives 10.2.2 (FP7) under Excel 2016. Login e.g. to the database "SData" with user "Admin" and password "apple" is possible without problems in server explorer.
Now I try to execute this VBA macro in this Excel instance. The code is mostly taken from the supplied TM1 samples.
The function "TM1SystemServerNof" returns the value 0.Private Sub DoStart()
Dim sHostName As String
Dim sUserName As String
Dim sPassword As String
Dim sTM1DBName As String
Dim hUserHandle As Long
Dim pPoolHandle As Long
Dim vPassword As Long
Dim vServerName As Long
Dim vUserName As Long
Dim vStringLength As Long
Dim RetVal As String * 75
Dim i As Long
Dim lngCount As Long
Dim vServerHandle As Variant
'
' Each Microsoft Visual Basic application begins by calling TM1APIInitialize,
' TM1SystemAdminServerHostSet, and TM1SystemServerConnect.
'
'sHostName = "192.168.195.153"
sHostName = "tm1-develop"
sTM1DBName = "SData"
sUserName = "Admin"
sPassword = "apple"
TM1APIInitialize
hUser = TM1SystemOpen()
TM1SystemAdminHostSet hUser, sHostName
pPoolHandle = TM1ValPoolCreate(hUser)
vStringLength = TM1ValIndex(pPoolHandle, 10)
Call TM1SystemServerReload(hUser)
lngCount = TM1SystemServerNof(hUser)
Debug.Print "Number of TM1-Databases: " & lngCount
vUserName = TM1ValString(pPoolHandle, sUserName, vStringLength)
vPassword = TM1ValString(pPoolHandle, sPassword, vStringLength)
vServerName = TM1ValString(pPoolHandle, sTM1DBName, vStringLength)
vServerHandle = TM1SystemServerConnect(pPoolHandle, vServerName, vUserName, vPassword)
If TM1ValType(hUser, vServerHandle) = TM1ValTypeError() Then
Debug.Print "Fehlercode: " & TM1ValErrorCode(hUser, vServerHandle)
End If
'...
End Sub
Using "TM1SystemServerConnect" I get error code 87.
I tried the short name, long name and IP address of the host.
As far as SSL certification is concerned, I access this file: "C:\Program Files\ibm\cognos\tm1_64\bin\ssl\tm1ca_v2.pem" (due to configuration of TM1 Admin server).
Anybody got an idea?
Thank you in advance & kind regards,
Jörn