• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

size of table is increasing

 
deepak borole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have two tables in microsoft access......i am accessing records from 1st table and inserting them into the second table.......what i am doing is evrytime the code is run i am deleting records from the second table and then inserting new records in that table but the size of that table is going on increasing......so should i drop the table and create new table everytime from the java code...
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with MS Access database is that it doesn't automatically resize the file if the records are deleted. You need to compact it manually

Tools -> Database Utilities -> Compact & Repair Database

Or alternatively you can make Access to compact the database everytime it is closed.
Tools -> Options -> General -> Check "Compact on Close" option

As far as I know, there is no way you can do it through Java. There are ADOs available to perform this action. Check whether it is possible to call these ADOs nativly from Java code.

Note: I don't think deleting and recreating a table will solve this problem. If I remember correctly, the space is not redeemed even when the table is deleted. Please check.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic