企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1521|回复: 5

MS Access Code to execute process

[复制链接]

86

主题

397

帖子

596

积分

高级会员

Rank: 4

积分
596
QQ
发表于 2014-6-28 10:56:44 | 显示全部楼层 |阅读模式
Hey All,

I would like to insert a piece of vb code into MS Access to execute a Tm1 process.
If anybody knows the syntax for this. It would be much appreciated.

Regards,
回复

使用道具 举报

85

主题

419

帖子

604

积分

高级会员

Rank: 4

积分
604
QQ
发表于 2014-6-28 12:36:14 | 显示全部楼层
Since no client uses access I had to google if bat-scripts may be executed via access:  (apparently yes)

If you can indeed call bat-scripts (and this is applicable in your case), have a look at runti.exe
(especialy the 5th post, which contains the documentation) runti.exe is available since 9.5.2 HF1 but should work fine for older versions if you can get your hands on the exe.

copy this to a bat file to create the pwd and key file (I usually get confused which is which so I made the script. yes, I'm that lazy)
Code: @echo off
set base_path=%~dp0
set tm1crypt="Crogram Files (x86)CognosTM1bintm1crypt.exe"
set /P user=Username:
set /P pswd=Password:
set tm1crypt_arguments=-pwd %pswd% -keyfile "%basepath%tm1crypt_%user%_pwdkey.txt" -outfile "%basepath%tm1crypt_%user%_pwd.txt" -validate

%tm1crypt% %tm1crypt_arguments%

pause
(at least the .bat will attempt to create the files at the folder it resides in. if you put it at c:, run it as administrator. obvious? I got bothered with this twice this week. it's still Monday over here. Weeks do start with Monday.)

then use
Code: @echo off

rem set tm1adminhost=
set tm1server=cubica_test1
set tm1user=api
set pwd_path=C:UserslukasmDocumentsTM1_TABScubica_test1
set tm1runti="Crogram Files (x86)CognosTM1bintm1runti.exe"


set pwd="%pwd_path%tm1crypt_%tm1user%_pwd.txt"
set pwdkey="%pwd_path%tm1crypt_%tm1user%_pwdkey.txt"
set tm1runti_params=-process SYS_SecurityRefresh -adminhost %tm1adminhost% -server %tm1server% -user %tm1user% -passwordfile %pwd% -passwordkeyfile %pwdkey%
@echo on
%tm1runti% %tm1runti_params%

This script runs the process "SYS_SecurityRefresh" as user "api" with password information found at pwd_path
If your process has arguments, see the mentioned documentation - it should be easy to add.

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

87

主题

397

帖子

595

积分

高级会员

Rank: 4

积分
595
QQ
发表于 2014-6-28 13:00:41 | 显示全部楼层
Lukas Meyer wrote:runti.exe is available since 9.5.2 HF1 but should work fine for older versions if you can get your hands on the exe.
I'm pretty sure that is not true although I have not tested it. New TM1 features are almost always never backward-compatible.
回复 支持 反对

使用道具 举报

86

主题

415

帖子

604

积分

高级会员

Rank: 4

积分
604
QQ
发表于 2014-6-28 13:05:30 | 显示全部楼层
Tomok,

I'm guessing that RunTi accesses the API in a similar way to the batch files created on this site before it existed. It may work but I think it's not designed to so you may be right. Instead of using RunTi use the batch files from this site (available in helpful code) that are free and are know to work on multiple version,

Jim.
回复 支持 反对

使用道具 举报

80

主题

402

帖子

587

积分

高级会员

Rank: 4

积分
587
QQ
发表于 2014-6-28 14:14:48 | 显示全部楼层
Hey All,

Thanks for the replies.

We are running TM1 v9.5.2 HF2 at the moment. (Upgrading to 10 in the next couple of months).

So I guess the RunTi.exe will work?

I will test and give feedback.

Thanks!!!
回复 支持 反对

使用道具 举报

87

主题

428

帖子

615

积分

高级会员

Rank: 4

积分
615
QQ
发表于 2014-6-28 15:21:02 | 显示全部楼层
Hey All,

Thanks everything worked perfectly.

Regards,
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2023-10-3 19:28 , Processed in 0.075313 second(s), 11 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

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