Compacting Databases

This topic applies only to MS Access databases.

Two separate and independent procedures perform compaction of a Rangecam MS Access database. This is because the database has two components, one maintained by Microsoft Access, and one maintained directly by Rangecam.

All standard database tables are maintained by Access. They are stored in the files measrail.mdb and permrail.mdb. After much data is read or imported, or many database operations have taken place, these files may become inflated, taking up more disk space than necessary.

Shape information (including the shapes of measured profiles, unworn rails, and grinding templates) and images (photographs and bitmaps) are not stored within the Access database. They are stored in files maintained by Rangecam, named measrail.hsh and permrail.hsh. These are found in the database folder containing the .mdb files. Although they are not physically maintained by Microsoft Access, they are logically part of the same database. The .hsh file should always be kept in the same folder as the .mdb file of the same name.

First close the database in Rangecam, and make a backup copy. Then open measrail.mdb with Access. On the Tools menu., select Database Utilities, then Compact Database. The database window will disappear while the database is being compacted. Depending on the size of the database, compaction may take up to several minutes. When Access redisplays the database window, the compaction is complete. Space savings may be substantial. After importing several hundred miles of geometry or profile data, compaction may reduce the size of measrail.mdb by a factor of eight!

The same procedure can be applied to permrail.mdb, but as that database is smaller, the savings will be less dramatic.

The 'shape' files measrail.hsh and permrail.hsh are each limited to 2 Gb. A compaction utility is provided within Rangecam for measrail.hsh. It is useful only if run data has been deleted from the database, and there is a desire to recover the space. For detailed instructions, see section Compact Profile Data.