PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → MDB Compact & Repair
MDB Compact & Repair
Débuté par Lee Shroder, 17 oct. 2016 23:17 - 5 réponses
Posté le 17 octobre 2016 - 23:17
Hi All,

I have an application that is connected to an MDB file using native connectivity on Windev 21.

The MDB database has only a single table which is overwritten with data on a regular basis and never holds more than 500 records. It is a very simple flat record database.

The issue is over time the physical size of this database grows larger and larger 10's of MBytes. Performing a compact and repair from MS Access brings the database back down to under 1MB.

The target audience for this application may not have MS Access installed but will need the access database type for connection to third party applications, however the growing file size is a concern.

Is there a way from Windev to perform a compact and repair on an MDB file to reduce this growing size?

Thank you for your time :)


R L Solutions Ltd
Barcoding and Labelling Solutions
www.rlsltd.co.uk
Posté le 18 octobre 2016 - 08:26
Hi Lee,

you can automatically compact & repair an Access database whenever it is closed

https://support.office.com/en-us/article/Compact-and-repair-a-database-6ee60f16-aed0-40ac-bf22-85fa9f4005b2

Automatically compact and repair a database when it closes

You can select the Compact on Close database option if you want to automatically compact and repair a database when it closes.

Note: Setting this option affects only the database that is currently open. You must set this option separately for each database that you want to automatically compact and repair.

On the File tab, click Options.

In the Access Options dialog box, click Current Database.

Under Application Options, select the Compact on Close check box.

Under WINDEV: use Exerun(..) with command line options to start a manual repair & compact.
Posté le 18 octobre 2016 - 08:50
Yo can also have a second blank .mdb. Then Copy the records and replace the main file when needed.

Regards,
José Antonio.
Posté le 18 octobre 2016 - 13:30
Hi Guenter,

Thank you for pointing this out, I had come across this before but I assumed (probably incorrecrtly) that the compact and repair on close only worked when closing the database in Microsoft Access.

I will try this out later on today and let you know how I get on.

Thank you,

Lee
Posté le 18 octobre 2016 - 13:34
Hi José ,

Thank you for your suggestion, this is a great fallback option if I am unable to compact and repair on close.

Will update this post later with the final outcome.

Thank you very much for your guidance.

Lee
Posté le 20 octobre 2016 - 17:38
Hi All,

In conclusion the target clients for this application may not have MS Access installed on their computers and the compact on close is only relevant when opened from MS Access. Therefore I have had to go with the use of an empty database to prevent the database itself growing too large.

Thank you all for your assistance.

Kindest Regards,

Lee