tags:

views:

54

answers:

3

I think access databases should not be copied while a connection to them is open (.ldb locking file exists) as the copy file can be corrupt. However will the copy file be corrupt only if a edit/add/delete is carried out while the file is being copied. I'm thinking of situations where a connection to the database is left open all the while the client application is running. Specifically I'm wondering about over-night backups where a user leaves on their machine overnight.

+1  A: 

That should be fine.

You should be able to copy the file without any problems.

I just tested this, and if the user was in the middel of an update to a record, the new copy only has the original value of the row, not the values being edited.

astander
great thanks, that's what I was hoping for
jjb
You can't count on the data being accurate. Yes, if everyone has gone home and there is no long running process running you won't have a problem. But you can't assume that this will working during the day. For example what if the user was to save the record while you were copying the file and you had already copied the index fields but not the data field. Things would be very screwed up.
Tony Toews
+2  A: 

You might like to consider Automatically Logging-Out Idle Users

Remou
I definitely should look into that
jjb
Which the author of that posting got from the MS KB.HOW TO: Detect User Idle Time or Inactivity in Access 2000 (Q210297)http://support.microsoft.com/?kbid=210297ACC: How to Detect User Idle Time or Inactivity (Q128814)http://support.microsoft.com/?kbid=128814
Tony Toews
+2  A: 

I've never experienced a problem when copying a database whilst in use. This doesn't mean it's a good idea of course....

You may want to look at some kind of mechanism to automatically kick users out of the database after n hour or at a certain time of day.

Simon
I kind of thought it should be OK but was far from sure. Still I guess I should not rely on it
jjb
You should not rely on it if it is your only backup. It may work 99 out of 100 times and that 100th time will be the one where you need a non-corrupt, complete backup.
David-W-Fenton
David, what if I copy the database, then copy it again, then compare the 2 copies and if they are identical then assume they are structurally sound?
jjb
Making two copies of the same disk image of the file that is not actually up-to-date is not going to get you anything. Keep in mind that part of the "real" data may be in a temp file in the user's temp directory, not yet fully posted to the shared file. The only reliable way to get a hot backup of a Jet/ACE data file is to use Jet/ACE functionality to copy the data to a new file via Jet/ACE processes. This still might not get you the ideal backup, but it will be guaranteed non-corrupt (though the data could still be inconsistent)
David-W-Fenton