Tables.Add Name [, Id]
Adds a new Table object to the Tables collection.
This method will fail if the name of the new table is illegal (invalid or duplicate).
If a Unique ID is not specified for the second parameter, the method will generate a Unique ID for the new table.
If the Unique ID is specified, the Id should be unique among all objects.
Note: The string representing the Unique ID is case sensitive.
Parameters | Description |
Name | Required. Specifies the name of the new Table. Type: String |
Id | Optional. Specifies the Unique ID of the Table object. The ID has the following format: a 17 character string consisting of two 8 hex-digit (0,1,2,3,4,5,6,7,8,9,a,A,b,B,c,C,d,D,e,E,f,F) numbers (32 bit integers) separated by comma. For example: 000012AB,0000f1f2 If the Unique ID is not specified, the method will generate an id for the new Table object. Type: String |
Object
This example adds the table called COUNTRY to the tables collection. In this case, the unique table Id is set.
Sub Main()
Dim objImpApp As Object
Dim objImpCat As Object
Dim objDB As Object
Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.OpenCatalog "C:\Catalogs\Sample.cat"
Set objImpCat = objImpApp.ActiveCatalog
Set objDB = objImpCat.Databases(1)
objDB.Tables.Add "COUNTRY","00123ABC,0f0d0e0b"
objImpCat.Save
Set objDB = Nothing
Set objImpCat = Nothing
Set objImpApp = Nothing
End Sub