MS Access Code to execute process

Post Reply
Mems
Posts: 58
Joined: Thu Apr 14, 2011 12:27 pm
OLAP Product: TM1
Version: v10.2.2
Excel Version: 2010
Location: South Africa

MS Access Code to execute process

Post by Mems »

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,
MEMS
Lukas Meyer
Posts: 51
Joined: Thu Jul 24, 2008 6:14 am

Re: MS Access Code to execute process

Post by Lukas Meyer »

Since no client uses access I had to google if bat-scripts may be executed via access: http://bytes.com/topic/access/answers/4 ... oft-access (apparently yes)

If you can indeed call bat-scripts (and this is applicable in your case), have a look at runti.exe http://www.tm1forum.com/viewtopic.php?f=3&t=5176
(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: Select all

@echo off
set base_path=%~dp0
set tm1crypt="C:\Program Files (x86)\Cognos\TM1\bin\tm1crypt.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: Select all

@echo off

rem set tm1adminhost=
set tm1server=cubica_test1
set tm1user=api
set pwd_path=C:\Users\lukasm\Documents\TM1_TABS\cubica_test1\
set tm1runti="C:\Program Files (x86)\Cognos\TM1\bin\tm1runti.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.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: MS Access Code to execute process

Post by tomok »

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.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: MS Access Code to execute process

Post by jim wood »

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.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Mems
Posts: 58
Joined: Thu Apr 14, 2011 12:27 pm
OLAP Product: TM1
Version: v10.2.2
Excel Version: 2010
Location: South Africa

Re: MS Access Code to execute process

Post by Mems »

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!!!
MEMS
Mems
Posts: 58
Joined: Thu Apr 14, 2011 12:27 pm
OLAP Product: TM1
Version: v10.2.2
Excel Version: 2010
Location: South Africa

Re: MS Access Code to execute process

Post by Mems »

Hey All,

Thanks everything worked perfectly.

Regards,
MEMS
Post Reply