I'm trying to connect to a catalog local to my machine, create a new table, and then add columns to it. Or, the table might already be created, so I'd have to add a column to a pre-created table. I am coding like this, but getting an error:
Dim objDB As Object
Dim objImpApp As Object
Dim objImpCat As Object
Dim strTableName As String
objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.OpenCatalog("C:\STI\Test\test.cat", "Creator", "test", "test")
objImpCat = objImpApp.ActiveCatalog
objDB = objImpCat.Databases("Test")
objDB.Tables.Add("Table1")
objImpCat.Save()
objDB = Nothing
objImpCat = Nothing
objImpApp = Nothing
It's erroring on "objDB.Tables.Add("Table1")". I think I might be accessing the "Databases" incorrectly. I have tried using the name of the Database Gateway and my ODBC connection name, but no go. Anyone know what I'm doing wrong, and how to add columns to the new table? Please let me know if I need to describe something in more detail...
Dim objDB As Object
Dim objImpApp As Object
Dim objImpCat As Object
Dim strTableName As String
objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.OpenCatalog("C:\STI\Test\test.cat", "Creator", "test", "test")
objImpCat = objImpApp.ActiveCatalog
objDB = objImpCat.Databases("Test")
objDB.Tables.Add("Table1")
objImpCat.Save()
objDB = Nothing
objImpCat = Nothing
objImpApp = Nothing
It's erroring on "objDB.Tables.Add("Table1")". I think I might be accessing the "Databases" incorrectly. I have tried using the name of the Database Gateway and my ODBC connection name, but no go. Anyone know what I'm doing wrong, and how to add columns to the new table? Please let me know if I need to describe something in more detail...