ArcObjects Library Reference (GeoDatabase)  

ILocalDatabaseCompact Interface

Provides access to members for compacting a file or personal geodatabase.

Product Availability

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


Method Compact Compacts the database.

CoClasses that implement ILocalDatabaseCompact

CoClasses and Classes Description
AccessWorkspaceFactory (esriDataSourcesGDB) ESRI Access Workspace Factory.
FileGDBWorkspaceFactory (esriDataSourcesGDB) File GeoDatabase Workspace Factory.


ILocalDatabaseCompact is an optional interface supported by AccessWorkspaceFactories and FileGDBWorkspaceFactories that allows compaction of an Access database using the services of the Jet Engine or compaction of the files contained within a File Geodatabase workspace.

After using a Personal or File geodatabase, the database may become fragmented on disk. Compact rearranges how a fragmented Personal or File geodatabase is stored on disk. Compacting a Personal or File geodatabase often reduces its size and improves its performance.

The Compact method on ILocaDatabaseCompact takes a WorkspaceName object as an argument, so its not necessary to open the workspace before compacting it. The IDatabaseCompact interface on a file and personal geodatabase workspace also supports a Compact method.