企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 303|回复: 1

Process not running in VB

[复制链接]

77

主题

392

帖子

558

积分

高级会员

Rank: 4

积分
558
QQ
发表于 2014-3-16 10:45:47 | 显示全部楼层 |阅读模式
Hi,

I'm using VB in order to generate integrated login and then to run a process.
The integrated login establish well, but still the process is not running (The VB finish without errors but the TM1 not showing any change in data).
I used the following code for the process:

Code: Sub RunProc ( hPool As Long, hServer As Long)

Dim hProcess As Long
Dim voProcess As Long
Dim lReturn As Long
Dim hParamArray As Long
Dim voParamArray(0) As Long

voProcess = TM1ValString(hPool, "Save_Data" , 0)
hProcess = TM1ObjectListHandleByNameGet(hPool, hServer, TM1ServerProcesses, voProcess)
voParamArray(0) = TM1ObjectNull()
hParamArray = TM1ValArray(hPool, voParamArray, 0)
lReturn = TM1ProcessExecute(hPool, hProcess, hParamArray)
   
End Sub


What I did wrong? Thanks

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

73

主题

375

帖子

530

积分

高级会员

Rank: 4

积分
530
QQ
发表于 2014-3-16 15:07:04 | 显示全部楼层
Hi,
your code is working for me. I didn't test with Integrated login but I need to assume that the hServer handle which is passed from a different routine already did the connect. You should check your hProcess handle against TM1ValTypeError()  (see example). Thus you check hServer indirectly. Hope this helps.

Code: Sub RunProc(hPool As Long, hServer As Long, hUser As Long)
    Dim hProcess As Long
    Dim voProcess As Long
    Dim lReturn As Long
    Dim hParamArray As Long
    Dim voParamArray(0) As Long

    voProcess = TM1ValString(hPool, "Save_Data", 0)
    hProcess = TM1ObjectListHandleByNameGet(hPool, hServer, TM1ServerProcesses, voProcess)
    If TM1ValType(hUser, hProcess) = TM1ValTypeError() Then
        Stop
    End If
    voParamArray(0) = TM1ObjectNull()
    hParamArray = TM1ValArray(hPool, voParamArray, 0)
    Call s_TestHandle(hParamArray, hUser)
    lReturn = TM1ProcessExecute(hPool, hProcess, hParamArray)
    Call s_TestHandle(lReturn, hUser)

End Sub

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|企业绩效管理网 ( 京ICP备14007298号   

GMT+8, 2020-11-28 21:13 , Processed in 0.132502 second(s), 13 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表