General discussion

Locked

MS Access Database Compacting

By eunan.watters ·
If anyone can provide advise on this topic it would be
much appreciated -
I work extensively with MSAccess 97 - one truly inefficient aspect
which I wish to get to the bottom of relates to the mb taken
up by active databases. The size keeps increasing requiring
continual compacting - is there maintenance I can perform
to overcome this feature ???

Many thanks

Eunan

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MS Access Database Compacting

Repairing and compacting is the maintenance you do to deal with this aspect of Access databases
Look up compacting databases for general info on the topic and CompactDatabase for an example ofhow this can be done in code.
Hope this helps
John

Collapse -

MS Access Database Compacting

There is also a command line (startup) option which you can use from a batch or script file to do the job.

Collapse -

MS Access Database Compacting

by eunan.watters In reply to MS Access Database Compac ...

Poster rated this answer

Collapse -

MS Access Database Compacting

by donq In reply to MS Access Database Compac ...

There is an Access feature that allows "Admin" to set Access up so it will "Compact" automatically whenever it is closed. ALL databases act the same way once this application property is set while NO databases are open. Repeat the process on any machine, or on the server + once on each front-end machine.

Collapse -

MS Access Database Compacting

by eunan.watters In reply to MS Access Database Compac ...

Poster rated this answer

Collapse -

MS Access Database Compacting

by Crowmoor In reply to MS Access Database Compac ...

There are also the posibility to add this code:

Dim fs as Object
Dim myfile

Set fs = CreateObject("Scripting.FileSystemObject")
dbEngine.CompactDatabase "Currentdb.mdb", "Nedb.mdb"

Set myfile = fs.Getfile("Currentdb.mdb")
myfile.delete
set myfile = fs.Getfile("Newdb.mdb)
myfile.rename "newdb.mdb", "Currentdb.mdb"


Not sure about the last line but as always you should debug code you get from places like this.

Hope this help!

Jesper

Collapse -

MS Access Database Compacting

by eunan.watters In reply to MS Access Database Compac ...

Poster rated this answer

Collapse -

MS Access Database Compacting

by eunan.watters In reply to MS Access Database Compac ...

This question was closed by the author

Back to Web Development Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums