Page 1 of 1
Problems with TM1 VB API in 9.5.2
Posted: Mon Nov 21, 2011 3:43 pm
by vladkon
I am having problems with connecting to TM1 admin in 9.5.2. I have some code code originally developed with VB6. The system needs to be upgraded to 9.5.2, but fails while trying to connect to admin host. I copied the following code from api guide in order to try check the connection but it also does not work. The same code works fine when I am trying to connect to the same model in 9.5.1 - the cfg files are the same, so it does not seem to be a configuration problem.
Private Sub Command1_Click()
Dim sServerName As String
Dim sUserName As String
Dim sPassword As String
Dim hUserHandle As Long
Dim pPoolHandle As Long
Dim vPassword, vServerName, vUserName As Long
Dim vStringLength As Long
Dim RetVal As String * 75
Dim lcount As Integer
Dim sResult As String
Dim hServer As Long
TM1APIInitialize
hUser = TM1SystemOpen()
TM1SystemAdminHostSet hUser, "adminhost"
pPoolHandle = TM1ValPoolCreate(hUser)
vStringLength = TM1ValIndex(pPoolHandle, 10)
vUserName = TM1ValString(pPoolHandle, "admin", vStringLength)
vPassword = TM1ValString(pPoolHandle, "apple", vStringLength)
vServerName = TM1ValString(pPoolHandle, "sdata", vStringLength)
hServer = TM1SystemServerConnect(pPoolHandle, vServerName, vUserName, vPassword)
lcount = TM1SystemServerNof(hUser)
lcount - returns 0 in 9.5.2, and 1 in 9.5.1. Can anyone help with some idea what can be wrong here?
Thanks in advance.
Re: Problems with TM1 VB API in 9.5.2
Posted: Mon Nov 21, 2011 4:07 pm
by qml
What is the IntegratedSecurityMode parameter value in tm1s.cfg in the 9.5.2 environment? Is it maybe set to 4 or 5 to use Cognos 8 security?
Re: Problems with TM1 VB API in 9.5.2
Posted: Mon Nov 21, 2011 4:31 pm
by vladkon
no - IntegratedSecurityMode=1
Re: Problems with TM1 VB API in 9.5.2
Posted: Mon Nov 21, 2011 5:46 pm
by Alan Kirk
vladkon wrote:I am having problems with connecting to TM1 admin in 9.5.2. I have some code code originally developed with VB6. The system needs to be upgraded to 9.5.2, but fails while trying to connect to admin host. I copied the following code from api guide in order to try check the connection but it also does not work. The same code works fine when I am trying to connect to the same model in 9.5.1 - the cfg files are the same, so it does not seem to be a configuration problem.
Private Sub Command1_Click()
Dim sServerName As String
Dim sUserName As String
Dim sPassword As String
Dim hUserHandle As Long
Dim pPoolHandle As Long
Dim vPassword, vServerName, vUserName As Long
Dim vStringLength As Long
Dim RetVal As String * 75
Dim lcount As Integer
Dim sResult As String
Dim hServer As Long
TM1APIInitialize
hUser = TM1SystemOpen()
TM1SystemAdminHostSet hUser, "adminhost"
pPoolHandle = TM1ValPoolCreate(hUser)
vStringLength = TM1ValIndex(pPoolHandle, 10)
vUserName = TM1ValString(pPoolHandle, "admin", vStringLength)
vPassword = TM1ValString(pPoolHandle, "apple", vStringLength)
vServerName = TM1ValString(pPoolHandle, "sdata", vStringLength)
hServer = TM1SystemServerConnect(pPoolHandle, vServerName, vUserName, vPassword)
lcount = TM1SystemServerNof(hUser)
lcount - returns 0 in 9.5.2, and 1 in 9.5.1. Can anyone help with some idea what can be wrong here?
I'd trim that quote but all of it is relevant.
I think you're confusing a couple of different concepts here.
TM1SystemServerNof doesn't have anything to do with the login to an individual server, the handle to which you obtain via TM1SystemServerConnect. It returns the number of servers that are registered with the relevant Admin Server. Therefore to get a value from that, it's not necessary to log in to a specific server. (And, consequently, it doesn't have anything to do with the .cfg file, which again relates to a specific server rather than the
list of servers which is registered by the Admin Server.) In other words it's the Admin server, not a TM1 server, which furnishes this value.
The two things that you need to look at are:
(a)
Code: Select all
TM1SystemAdminHostSet hUser, "adminhost"
Is this the real name of the admin host, that is, the box that the Admin Server is running on? Is the Admin Host for the 9.5.2 session the same as the one for the 9.5.1 session? If not, you need to change it.
And
(b) You should always call the TM1SystemServerReload function before calling TM1SystemServerNof. This is the equivalent of pressing [F5] in Server Explorer to refresh the servers list.
Re: Problems with TM1 VB API in 9.5.2
Posted: Tue Nov 22, 2011 9:59 am
by vladkon
Hi Alan, thank you for insight, the problem was in tm1admsrv.ini - adding SupportNonSSLClients=True solved it!
Re: Problems with TM1 VB API in 9.5.2
Posted: Tue Nov 22, 2011 8:14 pm
by Alan Kirk
vladkon wrote:Hi Alan, thank you for insight, the problem was in tm1admsrv.ini - adding SupportNonSSLClients=True solved it!
Ah, that's one to watch for!
Thanks for taking the time to report back with how you solved it.