0

Generally you can copy a file even though it is being used and paste it into a different location.

However, I am unable to copy an MS Access file when it is being used, I get an error that the file is being used by another process. Is there any way to copy an MS Access file that is being used?

variable
  • 8,262
  • 9
  • 95
  • 215

4 Answers4

0

Access files are shared database files.

That means, multiple users can write to and read from the same file at the same time, and Access has locks to prevent users writing things that other users are actively writing to, to prevent conflicts.

When a user starts writing, for example, by adding a row, but hasn't finished writing yet, it might leave the database in an inconsistent state (with half a row). This is a bit of a simplification, but with users actively using a database, corruption is certainly possible. It especially happens when Access needs to move stuff around, which happens when files are substantially extended (by adding tables, for example).

Other applications generally don't have multiple users working on a single file together, so can just write the data when someone saves/closes a file.

See this for some code that copies an open database file while not risking inconsistency.

Shadow copies can of course be used too, but you may very well end up with a corrupt copy.

Erik A
  • 31,639
  • 12
  • 42
  • 67
  • It is opened in shared mode. This was working earlier this month. It looks like I'm impacted by this issue- https://support.microsoft.com/en-us/office/error-in-access-when-opening-a-database-on-a-network-file-share-6cbc1560-62c2-46e7-9980-d079a46f5acc even after installing the latest update I get the same error. What do you think? – variable Dec 21 '21 at 15:30
  • Could certainly be, but that only affects code with `OpenDatabase` afaik. I'd need to know exactly what you're doing. Generally, though, copying an Access database while in use, even when not blocked, is a bad idea, since the corruption can occur silently. – Erik A Dec 21 '21 at 15:33
  • I can neither copy or open an access db file, even though I have full permissions on the folder and file. I get the error msg that file is already in use. In the folder I cannot see the lock file and this indicates file is opened exclusively by some user. But it isn't. I'm not sure what to do now. – variable Dec 21 '21 at 16:59
  • Well, start by checking the file share, listing open connections to the file and optionally disconnecting them – Erik A Dec 21 '21 at 17:06
0

You certainly can copy an open database file right away, but it has to be opened as shared.

However, if you open it exclusively, it cannot be copied, because Access locks the file.

Gustav
  • 53,498
  • 7
  • 29
  • 55
  • It is opened in shared mode. This was working earlier this month. It looks like I'm impacted by this issue- https://support.microsoft.com/en-us/office/error-in-access-when-opening-a-database-on-a-network-file-share-6cbc1560-62c2-46e7-9980-d079a46f5acc even after installing the latest update I get the same error. What do you think? – variable Dec 21 '21 at 15:29
  • If so, run the update. – Gustav Dec 21 '21 at 15:30
0

You can rather split the database into the back end and front end

Give each user a copy of the front end

Then you can always copy your own copy of the front end and back end anytime

Sola Oshinowo
  • 519
  • 4
  • 13
0

If you have any forms open that have a record source linked to a table, this will not allow the copy/paste

Steve
  • 1