无法使用Cognos TM1 API连接到为CAM(活动目录钩子)配置的服务器



是否有办法连接到使用TM1 API在VBA中使用CAM身份验证的服务器?

我已经尝试了以下代码基于这里找到的答案:
systemservercamsecurity使用Cognos进行身份验证时必需的错误

Dim credentials(1 To 3) As Long
credentials(1) = TM1ValString(hPool, Trim(CAMNamespace), 0)
credentials(2) = TM1ValString(hPool, Trim(ClientName), 0)
credentials(3) = TM1ValString(hPool, Trim(ClientPassword), 0)
vCredentials = TM1ValArray(hPool, credentials, 3)
hServer = TM1SystemServerConnectWithCAMNamespace(hPool, vServerName, vCredentials)

但是,这会导致Excel崩溃。

我知道我连接到正确的服务器,我知道用户名/密码是正确的,我知道TM1 API也正确安装在我的计算机上。

基于IBM客户支持和我之间的对话,我提出了这个解决方案。

它要求您添加以下声明函数:

Declare PtrSafe Function TM1SystemServerConnectWithCAMNamespace Lib "tm1api.dll" (ByVal hPool As Long, ByVal vServerName As Long, ByVal vCAMArr As Long) As Long

登录码:

Dim hArray As Long
Dim lArray(3) As Long
'Login to TM1 using CAM authentication
hArray = TM1ValArray(hPool, lArray(), 3)
TM1ValArraySet hArray, TM1ValString(hPool, "DOMANIN_NAME", 0), 1          
TM1ValArraySet hArray, TM1ValString(hPool, “TM1_USER_NAME”, 0), 2
TM1ValArraySet hArray, TM1ValStringEncrypt(hPool, “TM1_PASSWORD”, 0), 3
hServer = TM1SystemServerConnectWithCAMNamespace( _
    hPool, TM1ValString(hPool, "TM1_SERVER_NAME", 0), hArray)       

相关内容

  • 没有找到相关文章

最新更新