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

Add Table And Columns Through VB.NET?

Status
Not open for further replies.

Wease7

Programmer
Aug 29, 2003
13
US
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top