After creating a definition query based on a joined field, opening an attribute table in ArcMap returns the following error:
Error getting list of OIDs.
This error may occur if:
The join was created between a DBF table and a personal geodatabase feature class layer with a set defnition query.
The name of the feature class begins with a number.
The tables participating in the join do not have primary keys defined.
The feature class layer has a definition query that uses a field from a joined table (ArcGIS 9.0 only).
The index of the shapefile feature class is corrupt.
Solution or Workaround
The following solutions correspond to the above causes:
Remove the join and definition query from the feature class layer. Create the join between the DBF table and the feature class, and set the definition query.
Change the name of the feature class so it does not begin with a number.
Change or set the primary key field of a stand alone table in Microsoft Access. For more information about formatting tables in Microsoft Access for use in ArcMap, please see the Related Information section below.
Install Service Pack 3 for ArcGIS Desktop 9.0 or Service Pack 2 for ArcGIS Desktop 9.1. See the Related Information section below.
Use the ShapeFile Repairer or Shapefile Repair Tool utilities to rebuild the spatial indexes. See the Related Information section below to download.
For the ShapeFile Repairer utility to work correctly, ensure the language setting of the computer matches the language used to create the shapefile.
Please be aware that third-party scripts and extensions are unsupported by Esri. It is highly recommended that a backup copy of the shapefile be created before running the file through this utility.