无法使用 Cognos TM1 连接到为 CAM(活动目录挂钩)配置的服务器 API
Cannot connect to server configured for CAM (Active directory hook) using the Cognos TM1 API
是否可以使用 TM1 API 连接到在 VBA 中使用 CAM 身份验证的服务器?
我已根据此处找到的答案尝试了以下代码:
SystemServerCAMSecurityRequired error when authenticating using 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)
是否可以使用 TM1 API 连接到在 VBA 中使用 CAM 身份验证的服务器?
我已根据此处找到的答案尝试了以下代码:
SystemServerCAMSecurityRequired error when authenticating using 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)