0

I am developing a management system that uses an Access Database to store data. The database is updated frequently and due to this it tends to bloat.

The user doesn't have Microsoft Access, but has Windows 10.

Is there a way to programmatically compact the Access Database (.accdb) on a regular basis, for example, whenever he backs up and restores the database?

Preferably in Java, but if your solution is in a different language how would I execute it within the Java application?

Thank you

Cpt_Pi
  • 1
  • 2
  • You say that the user "doesn't have Microsoft Access", so how is your application manipulating the database file? Is it going to run as a 32-bit application and use the older .mdb file format so that the Jet database engine (which ships with Windows) is an available option for compacting? – Gord Thompson Nov 02 '16 at 22:31
  • @GordThompson, apologies for the delayed response, the application manipulates the database (.accdb) without needing MSAccess to be installed. We have tested it on multiple computers that don't have MSAccess and it has worked flawlessly. **Edit:** Right now, in order to manipulate the database our application is using UCanAccess to connect to the Database. – Cpt_Pi Nov 24 '16 at 05:31
  • @GordThompson Should I convert the `.accdb` database to `.mdb` and implement a function that executes the Jet compress instruction? How would I go about doing that? – Cpt_Pi Nov 27 '16 at 15:45
  • Yes, that is a possibility provided that your application would be running under a 32-bit JVM on Windows, in which case you could shell out and run a little VBScript using the general approach presented [here](http://stackoverflow.com/a/35272368/2144390). – Gord Thompson Nov 27 '16 at 16:05

0 Answers0