|
发表于 2014-6-12 06:31:22
|
显示全部楼层
tomago wrote:We have changed from Security mode 1 - 5
we used to have a macro which would connect to cognos via N_Connect command
Now we are using Security mode 5, this no longer works.
Can someone please help with the API code that is needed to connect automatically via macro?
Sorry, but there isn't any. Not that connects like N_Connect, anyway.
There are two ways of working with the API in VBA. The first is to obtain a user handle by passing the server, user and password information to the SystemServerConnect function. The problem with this is that the resulting user handle can only be used in the VBA API code; it does not connect your Excel client to the server, it only connects the VBA code to the server. So if you wanted to go down this path, you would have to essentially create your own TM1 client using VBA API code which would be a rather painful amount of work to do. You could literally put a couple of years' of work into it.
And then find out that IBM had left out some critical functions from the API.
Or you may come across some undocumented API functions that seem to do what you need but which seem to work erratically and raise a service request. And still be waiting for an answer coming up to 3 months later. I know of what I speak.
The other way is kind of the reverse of that. Instead of obtaining a user handle through the API you borrow one from the Excel client through the undocumented but essential (for Excel VBA API code anyway) function. However obviously the client needs to already be logged in.
In short, the only way to connect the excel client by code is through N_Connect, but note the comment attached to the function in the 10.2 Reference Guide:Note: The N_CONNECT function is not supported when a server is using Integrated Login or IBM Cognos 8 security for authentication. This function can only connect to a server that is configured to use standard TM1 authentication.
I believe that this is a euphemism for "tough luck, Charlie". (Though to be fair N_Connect wouldn't make sense with integrated login. I have no personal experience of CAM logins, so I can't speak to that.) What I can tell you, though, is that the API's not going to get you around this one. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|