Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu macro - creator - password 1

Status
Not open for further replies.

Navik

Programmer
Apr 23, 2001
12
0
0
US
I set all of our classes to be password protected, and now I seem to have a problem with my macros running reports. I'm guessing it's because it doesn't have the password to send along with the class it sends. Can anyone give me some example macro script for sending the password along in the macro?

Thanks,
Navik
 
Yes you can enter passwords when opening Impromptu reports with macros but the big problem is that even in the 'compiled' macro the password is visible as free text. There are ways round that but they're not perfect.

Another way round it is to use the scheduler which alows you to enter passwords.

Simon Rouse
 
What I ended up doing was creating a class with no authority that could only run reports, then used that class in the macro. But now that you mention it, I am running the compiled macro with the scheduler, so I'll take a look at the scheduler, that's probably the solution I'd prefer.

Thanks,
Navik
 
Navik,

The actual syntax for sending the password along is:

ObjImpApp.OpenCatalog filename,UClass,UCPwd,DBID,DBPwd,1.

The final ',1' ensures that the catalog connects to the database before stepping to the next command.

Simon is right about the problem with passwords appearing as clear text, even in the compiled .mcx file. To get around this I created a simple encrypt/decrypt routine, which I put into a library macro and use with the '$Include statement in other macros. See thread401-305724 for details on that routine.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Dave:
the syntax you gave above:

The actual syntax for sending the password along is:

ObjImpApp.OpenCatalog filename,UClass,UCPwd,DBID,DBPwd,1.

Is suppose to be :

........UCBID,UCPwd,UCPwd,1.
I tried the syntax you have and it keep telling me that no data is there for export, just started working on macro this early morning..


Thanks,
Tusky
IT/Programmer
 
Tusky,

I have literally hundreds of macros that do this. The syntax is as I gave it. I do not send along the database ID and password in mine as I embed them in the catalog, but you still need to include the commas for them. Like Navik above, I do this with a 'Run_Only' user class that has no password, but I have an encryption subroutine for avoiding clear text passwords when I do an ODBC connection.

In my macros, I connect with:

ImpApp.OpenCatalog CatDir+"\"+Cat1,"Run_Only",,,,1

Has worked fine since version 3 with no changes.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Dave,
Thanks, well I tried it it wouldn't work and I have the user ID and then password and password..and it worked fine....anyways [2thumbsup] for the thred on how to encrypt..it was very helpful...thanks again

Thanks,
Tusky
IT/Programmer
 
All I can say Tusky is that I've learned all the above from Dave in the past and I had no problems. I suggest you persevere because once you've got it working it can make life so much easier for novice users on protected systems.

Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top