Error: Number of shapes does not match number of table records
The following error occurs when adding a shapefile to an ArcMap Data Frame:
Error: Number of shapes does not match number of table records.
The error is returned when the number of features in the shapefile does not match the number of records in the DBF table, which is the attribute table of the shapefile. Below are some common causes that produce the error.
- Adding or deleting records to the DBF table in another software package, such as Microsoft Excel or Microsoft Access.
- A system failure occurs while the shapefile is being edited and the shapefile is saved in a corrupted state.
- More than one user is editing the same shapefile at the same time.
- While adding features to the shapefile, double-clicking the mouse. A record with zero area is added to the table, but the feature has no geometry and is not visible in the view.
Solution or Workaround
The shapefile may be recovered by one of the following methods.
Warning: It is highly recommended that a backup copy of the damaged shapefile be made before attempting to use any of these methods.
Use Andrew Williamson's ShapeChecker repair utility
Note: For the ShapeChecker repair utility to work correctly, ensure the language setting of the computer matches the language used to create the shapefile.
This utility is a stand-alone product and does not require either ArcView GIS or ArcGIS Desktop to run.
Note: The workaround below pertains to a retired product, ArcInfo Workstation. There are no further updates to the product or its documentation, and Esri does not provide support relating to the product.
Edit the DBF file
This method may be attempted multiple times.
- Open the DBF file.
- Delete the last record.
- Save and close the DBF file.
- Load the shapefile into view.
- Download the ShapeChecker repair utility. Run the tool on the damaged shapefile.
- Use the ArcInfo Workstation SHAPEARC command:
- Run the SHAPEARC command on the shapefile.
- Run DESCRIBE on the output coverage.
- Make note of the number of shapes.
- Open the DBF corresponding to the shapefile.
- Compare the number of records of the DBF to the number of shapes resulting from the DESCRIBE command.
- If the number of DBF records is less than the number of shapes, add records until the number of shapes matches the number of records.
- If the number of DBF records is more than the number of shapes, delete records until the number of shapes matches the number of records.
- Save the DBF file.
The shapefile opens in ArcView, but there is no guarantee that attribute information for the shapefile is correct. To test if the attribute data is assigned to the correct feature, perform the following workflow:
- Load the shapefile into a new view.
- Open the attribute table for the shapefile.
- Tile the view and the table.
- Select a record.
- Compare the selected record with the selected feature in the view.
- If the feature does not correspond with the attribute, determine whether and where to add or delete records. The DBF must be edited appropriately, keeping in mind that the number of records must equal the number of shapes.
- Repeat the comparison steps until the features and attributes are synchronized.
Last Published: 7/19/2022
Article ID: 000003001
Software: ArcGIS-ArcEditor 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3, 8.2, 8.1.2, 8.1, 10 ArcGIS-ArcInfo 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3, 8.2, 8.1.2, 8.1, 8.0.2, 8.0.1, 10 ArcGIS-ArcView 9.3.1, 9.3, 9.2, 9.1, 9.0, 8.3, 8.2, 8.1.2, 8.1, 10 ArcView GIS 3.3, 3.2a, 3.2, 3.1, 3.0a, 3.0