ArcObjects Library Reference  (Carto)    

StandaloneTable CoClass

A standalone table.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Interfaces

Interfaces Description
IAttributeTable Provides access to the base table.
IClass (esriGeoDatabase) Provides access to members that return information about and manage the class.
IConnectionPointContainer Supports connection points for connectable objects.
IDataLayer Provides access to members that control the data source properties of a layer.
IDataLayer2 Provides access to additional members that control the data source properties of a layer.
IDataset (esriGeoDatabase) Provides access to members that supply dataset information.
IDisplayRelationshipClass Provides access to members that are used to set up joins.
IDisplayTable Provides access to members that work with the display table associated with a standalone table.
IObjectClassSchemaEvents (esriGeoDatabase) Provides access to events that occur with an object class' schema.
IPersist Defines the single method GetClassID, which is designed to supply the CLSID of an object that can be stored persistently in the system. IPersist is the base interface for three other interfaces: IPersistStorage, IPersistStream, and IPersistFile.
IPersistStream (esriSystem)
IRelationshipClassCollection Provides access to members that return the memory relationship classes defined for standalone tables or layers in ArcMap.
IRelationshipClassCollectionEdit Provides access to members that add and remove memory relationship classes from a standalone table or layer.
IStandaloneTable Provides access to members that control a standalone table.
ITable (esriGeoDatabase) Provides access to members that return information about and manage tables.
ITableDefinition Provides access to members that define a subset of the rows from the underlying table.
ITableFields (esriGeoDatabase) Provides access to members that return information about a table.
ITableSelection Provides access to members that control table selection.

Event Interfaces

Interfaces Description
ISelectionEvents (default) Provides access to events that occur when the selection changes.
IDefinitionExpressionEvents Provides access to events that occur when the Definition Expression changes.

Remarks

A StandaloneTable stores data that can be added to ArcMap and used in conjuction with the layers on your map. This data doesn't display on your map, but is listed in the table of contents on the Source tab. You can work with the data in a StandaloneTable  as you would work with the tablular information of geographic features. For example, you can view the table, add new fields, create graphs, and join it to other tables.

To access a StandaloneTable from your map use IStandaloneTableCollection. To access a StandaloneTable from a TableWindow, use ITableWindow2::StandaloneTable.

[Visual Basic 6.0]

Add a standalone table to ArcMap and run the InitEvents macro. Each time records are selected from the standalone table, the number of selected records and the ObjectID of each record is displayed in a messagebox. This code will work for 9.2 and later releases

Option Explicit 
Private m_pPlatFile As ITable
Private pTableSel As esriCarto.ITableSelection
Private WithEvents mTableSelEvents As esriCarto.StandaloneTable 
Private Sub InitEvents()   
    Dim pMxDoc As IMxDocument
    Dim pTColl As IStandaloneTableCollection  
    Set pMxDoc = Application.Document    
    Set pTColl = pMxDoc.FocusMap 
    Set m_pPlatFile = pTColl.StandaloneTable(0) 'gets first standalone table in TOC
    Set pTableSel = m_pPlatFile
    Set mTableSelEvents = m_pPlatFile 'Set events   
End Sub
 
Private Sub mTableSelEvents_SelectionChanged() 
    Dim pRow As IRow
    Dim pSS As ISelectionSet
    Dim pCursor As ICursor
    Set pSS = pTableSel.SelectionSet
    If pSS.Count > 0 Then 'if you ran through an debugged this, it would go through twice before hitting this section
        MsgBox "The total amount of rows selected: " & pSS.Count
        pSS.Search Nothing, False, pCursor
        Set pRow = pCursor.NextRow
        Do Until pRow Is Nothing
            MsgBox "The OID for this row is: " & pRow.Value(0)
            Set pRow = pCursor.NextRow
        Loop
    End If
End Sub

Working with Events

[Visual Basic 6.0]

When working with StandaloneTable's default outbound interface in Visual Basic 6 declare variables as follows:

Private WithEvents pStandaloneTable as StandaloneTable

When implementing IDefinitionExpressionEvents declare variables as follows:

Private WithEvents pRasterRendererMakerDefault as RasterRendererMakerDefault

Example

esriCarto StandaloneTable Example