Ever get an error message when opening a shapefile like, “Number of shapes does not match number of table records”? Yeah, well, neither have I. But if you ever do have such a problem, the Shape Checker utility might be able to rescue at least some, if not most of your data. It can re-generate a new .shx index file for your .shp file, add or delete lines to the .dbf file to match the number of shapes, and if your DBF file is totally hosed, can recreate a blank DBF for that shapefile. Not great, since you’ll lose whatever data you had in that datafile, but better than losing everything.
As the web page suggests, it’s probably best to do this on a copy of the corrupted file, rather than the original itself. Run the program:

Select the problematic .shp file with the left button, then recreate the .shx file with the “Build Shx” button. You can then check the DBF file for the proper number of records with the Check DBF button; if there are problems, or if the DBF file is missing, you’ll be given the option to fix it or create a blank one from scratch. I’ve tried it on point, line and polygon shapefiles I screwed up deliberately, and it worked as advertised. The program hasn’t been updated since 1999, but the author also provides the Delphi source code if you want to modify it yourself.
Other posts in the GIS Tools series
- Converting E00 Vector Data To Shapefiles - A Free And Fairly Painless Approach
- Simplifying Line And Polygon Shapefiles
- Converting US Census TIGER Data Into Shapefiles For Free
- Converting Shapefiles and ArcINFO Coverages To AutoCAD DXF Format
- Converting Point Shapefiles To Text/Spreadsheet Format
- Converting Text/Spreadsheet Files To Point Shapefile Format
- An Easier Way To Convert Shapefiles to Text/Spreadsheet Format
- Converting Text/Spreadsheet Data To Line/Area Shapefiles
- Full Resolution Raster Map Combining, Subsetting And Export With The TatukGIS Viewer
- Viewing Vector Data In The TatukGIS Viewer
- The LizardTech Stand-Alone MRSID Viewer
- Converting Raster Area Images Into Polygon Shapefiles
- SAGA GIS 2.0 Released
- ILWIS GIS Is Now Open Source
- AVHRR Analysis Add-On For ILWIS
- Advanced Image Mosaicking With Regeemy
- A Free GIS Viewer (And Cheap GIS Editor) For Windows Mobile Systems
- Updates For MapWindow And Saga GIS Programs
- Updates For Two Open-Source GIS Programs
- Putting Together A Basic Linux GIS Workstation
- Free Online Courses For Open Source GIS
- GIS-Oriented Linux Distributions
- Tabular Terrain Elevation Data
- Quick Data Gridding With QuikGrid
- A Good Introduction To Geospatial Data Analysis
- Converting Digital Elevation Models To Shapefile/DXF Contours
- Fixing "Broken" Shapefiles
- A Simple DBF Editor
- Two Online Vector GIS/GPS/KML Conversion Utilities
- Another Shapefile Repair Tool
- Quantum GIS (qGIS) Version 0.10 Released
- Online Raster Map Georeferencing/Registration With Map Rectifier
- Using The Demo Version Of Global Mapper As A Raster/Vector Data Viewer
- New Stable Release Of MapWindow GIS
- The Big List Of Free Metadata Software I
- The Big List Of Free Metadata Software II
- GIS On A Stick
- ILWIS 3.5 Released


saved me a number of times. I found the main cause was editing shapefiles over slow network connections.
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=17791