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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defining database in OpenCatalog command 1

Status
Not open for further replies.

websorg

Programmer
Jan 18, 2006
5
CN

Having a problem using Impromptu (version 7.1). The database used in creating reports is always the last one used. Trying to control the database to be used. In VB.NET, using OpenCatalog, coding:

------------------
Dim ImpromptuApplication As Object
Dim ImpromptuReport As Object
Dim connectionString As String

ImpromptuApplication = CreateObject("Impromptu.Application")

'following line doesn't change the database used
ImpromptuApplication.OpenCatalog("C:\catalog.cat", "myuserclass", "myuserclasspw", "myDBuser", "myDBpassword")

connectionString="user id=myuser;data source=mydatasource;persist security info=True;initial catalog=mycatalog;password=mypassword"

ImpromptuApplication.SetDBConnection(connectionString)

ImpromptuReport=ImpromptuApplication.OpenReport("c:\myreport.imr", "xx|yy")

ImpromptuReport.RetrieveAll()
etc
------------------

Can't understand how to switch the database being used programmatically.

Any help gratefully received
Thanks
 
websorg,

Sorry for the delay getting back to you.

I've found only two ways to change the database used for an Impromptu report.

The first is to change the definition of the logical database as defined in the cognos.ini file. This can be done programmatically, but it would not be a simple task. This change affects on the client computer on which it runs.

The second is to use a separate copy of the catalog that has a static association to another (different) database than the original. This change affects any user of the catalog, assuming it is on a network drive.

Both cases assume both databases contain the same structures, and only the data itself is different.

Hope this helps.

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
Magic with Data [pc2]
Want good answers? Read FAQ401-2487 first!
 
Dave,
Took the route of adjusting the Cognos.ini file programmatically. Was (still) hoping there may be another way (other than having separate catalogs as you also suggest)....

Many thanks
websorg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top