none
Access 2016 Desktop Compact and Repair RRS feed

  • Question

  • I use an access 2016 desktop database and in  through
    Options have chosen to Compact and Repair  at the close!
    But sometimes when I close the database I get the following message:
    "It is not possible to use the file because it is already used'
    This  sometimes  happens  and when I try to Compact and Repair from  the menu "File / Compact and Repair! For this database should tell you that not used by other users,
    Can anyone tell me what is happening and how I can fix this problem ?
    Tuesday, March 29, 2016 9:57 AM

All replies

  • Just tried to manually do a Compact and Repair and got the same error message as you got. I get it everytime as well. I've previously used this database with Access 2013 and lower and never got any error when compacting. I bet this is a bug in Access 2016.


    Best regards, George

    Tuesday, March 29, 2016 2:02 PM
  • Hi, charizanis

    There is a .laccdb file in the same folder as the .accdb file, with the same filename. This is a "lock" file created when you open the database; it should be deleted when you close, but sometimes isn't if you exit the database abnormally.

    You can also compact the database without opening it using the command

    msaccess.exe "X:\PathToYourDatabase\yourdata.accdb" /Compact

    Wednesday, March 30, 2016 1:58 AM
  • Hi, David 

    I know for the .accdb file but once I get this message
    This file is closed !! Obviously something else is to blame !

    Wednesday, March 30, 2016 2:44 PM
  • It's a timing issue. When starting the Compact and Repair, Access will try to close all it's open files. Due to the file system caching, the lock file (.laccdb) is not closed in time and thus the race error occurs.

    To the developers of Access: Make sure the lock file is closed (do not just assume it) before the compacting is initiated.


    Best regards, George

    Wednesday, March 30, 2016 2:50 PM