Sorry for my English, I write from Italy. I use the Access 2007 DB in a business data management procedure in VB Net. As is known, Access DBs expand during use and consequently I need to compact them when the program is closed. I perform the compaction in this way
Dim MioEngine As New Microsoft.Office.Interop.Access.Dao.DBEngine
MioEngine.CompactDatabase(myAccesDB, newAccessDB,)
Application.DoEvents()
but often and not on all PCs on the network, the compaction does not finish and gives me the following error message: The process cannot access the 'C:\myAccesDB.accdb' file because it is being used by another process Analyzing in depth what happens, I see that when the error occurs, the .laccdb file is not closed at the time of compacting. Is there any way other than the one I used to do the compacting safely? I specify that all the PCs in our network are Windows 10 pro and all updated; when Windows 10 was in its infancy, I didn't get this error.