Wouldn't MS Access(.mdb) file size reduce after deleting the content of database?

ms-access

Solution

MS Access doesn't reclaim the space for records until you have compacted the database.

This is something you should do to an access database as part of your regularly maintenance otherwise you will end up with some pretty painful problems.

You can compact a database either through the MS Access UI (Tools -> Database Utilities -> Compact and Repair Database) of you can use the command prompt using:

msaccess.exe "target database.accdb" /compact 

N.B. the /Compact switch must be after the target database

Problem

I was inserting data into a MS Access database using JDBC-ODBC driver. The blank mdb file was 2KB. After populating this database, the size grew to 155MB. Then I was deleting the data. But I found the size of mdb remains the same as 155MB. I don't get any errors. But is it normal this way? I would expect the file size reduces. If it is designed in this way, what is the idea behind it? Thanks

Original source