ArcObjects Library Reference  (DataSourcesFile)    

IArcInfoWorkspace.CreateInfoTable Example

[Visual Basic 6.0]
Public Sub testcreateinfo()
  Dim pwfact As IWorkspaceFactory
  Dim pAIWorksp As IArcInfoWorkspace
  Dim pPropertyset As IPropertySet
  'Open the arcinfo workspace
  Set pwfact = New ArcInfoWorkspaceFactory
  Set pPropertyset = New PropertySet
  pPropertyset.SetProperty "DATABASE", "D:\canada2"
  Set pAIWorksp = pwfact.Open(pPropertyset, 0)
  'Create a new info table
  Dim ptablenew As ITable
  Dim pAIItems As IArcInfoItems
  Set pAIItems = New ArcInfoItems
  Set ptablenew = pAIWorksp.CreateInfoTable("newtest", pAIItems)
End Sub


    //CreateInfo Table Example
    //REQUIRES: using ESRI.ArcGIS.Geodatabase;
    //e.g., database = "D:\\canada"
    //      nameOfTable = "newtest"
    public ITable CreateInfoTable_Example(string database, string nameOfTable)
        //this function opens an ArcInfo coverage using a property set.
        ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();
        // path to coverage workspace directory
        propertySet.SetProperty("DATABASE", database);
        IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesFile.ArcInfoWorkspaceFactoryClass();
        // open the workspace as an ArcInfoWorkspace
        ESRI.ArcGIS.DataSourcesFile.IArcInfoWorkspace workspace = (ESRI.ArcGIS.DataSourcesFile.IArcInfoWorkspace)workspaceFactory.Open(propertySet, 0);
        ESRI.ArcGIS.DataSourcesFile.IArcInfoItems arcInfoItems = new ESRI.ArcGIS.DataSourcesFile.ArcInfoItemsClass();
        ITable table = workspace.CreateInfoTable(nameOfTable, arcInfoItems);
        return table;

[Visual Basic .NET, C++]
No example is available for Visual Basic .NET or C++. To view a Visual Basic 6.0 or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.