If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

TR-3021,invalid login error in macro for refreshing cube

Started by techieaman, 19 Jan 2007 01:01:45 PM

Previous topic - Next topic

techieaman

Hi all,

I am using a macro to refresh mu cube. while executing it manually during testing an error (TR3021) Invalid login is encountered. Macro is as follows:

---------------------------------------------------------------------------------------------------------------------------------------------

Sub Main ()
Ã,  Dim objTransApp As Object
Ã,  Dim objModel As Object
Ã,  Dim strModelPath As String
Ã,  Dim strLocation As String
Ã,  Dim strModelSource As String
Ã,  Dim currentDate
Ã,  Dim currentTime
Ã,  Set currentDate = cvar(date)
Ã,  Set currentTime = cvar(time)

' *** File Names and Path(s) *****************************************************

Ã,  strLocation = "C:\Documents and Settings\tcbtr\Desktop\Cognos\Model\Monthly_Sales\"
Ã,  strModelSource = "SalesModel.mdl"
Ã,  strModelPath = strLocation & strModelSource

Ã,  '*** Open model inside Transformer**********************************************

Ã,  Set objTransApp = CreateObject("CognosTransformer.Application.cer4")
Ã,  'Set objModel = objTransApp.OpenModel(strModelPath,"DM_TAL_RPT","dm_tal_rpt","Root User Class")
Ã,  Set objModel = objTransApp.OpenModel(strModelPath)
Ã, 

Ã,  '*** Clean model and build cubes************************************************

Ã,  With objModel
Ã, 
Ã,  Ã,  Ã, .CreateMDCFiles
Ã,  Ã,  Ã, .Close

Ã,  End With

Ã,  ' *** Copy the Cubes to the destination


Ã,  Dim strCubePath As String

Ã,  ' *** Destination Folders*******************************************************

Ã,  Dim strCognosFolderÃ,  Ã,  Ã, As String


Ã,  ' *** Cube Names***************************************************************

Ã,  Dim strCubeÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, As String


Ã,  ' *** Set Source Folder Path***************************************************

Ã,  Ã, strCubePath = "C:\Documents and Settings\tcbtr\Desktop\Cognos\Cubes\"


Ã,  ' *** Set Destination Folder Path(s)*******************************************

Ã,  strCognosFolderÃ,  Ã, =Ã,  "C:\Documents and Settings\tcbtr\Desktop\Cognos\Refresh_Cube\"


Ã,  ' *** Set Cube Names*************************************************************

Ã,  strCubeÃ,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, =Ã,  "salescube & currentDate & currentTime.mdc"



Ã,  ' *** Copy Each Cube into the Destination Folders*********************************


Ã,  FileCopyÃ,  Ã,  Ã, strCubePath & strCube, strCognosFolder & strCube

Ã,  objModel.Close

Ã,  Set objCube = Nothing
Ã,  Set objTransApp = Nothing
Ã,  Set objModel = Nothing

Ã,  MsgBox "Refreshed Sales Cube has been created"


End Sub
----------------------------------------------------------------------------------------------------------------------------------------

MY datamart lies in oracle. I had added an entry for the database in cognos.ini file as:
DM_TAL_RPT=;LOCAL;OD;DSN=DM_TAL_RPT@ASYNC=0@0/0
Database is not lying on my machine too.
Morover the openmodel methods asks for a pwd,userid and userclass if the cube is secured. I believe it is not required in my case.

can anyone suggest what is the problem? Is my entry in cognos.ini file incorrect or model uid/pwd is needed?

looking for a quick help gurus.

thanks in advance.

regards,

aman