Compact and Repair error (1 Viewer)

Agism

Registered User.
Local time
Today, 07:19
Joined
Jun 25, 2001
Messages
44
Every morning I back up my databases and compact and repair them. The last few days, my backend has been giving me this error:


"Microsoft Access can't delete L:\KEYSupport\Maintenance Agreements\KTBackEnd.mdb after compacting it. The compacted database has been named L:\KEYSupport\Maintenance Agreements\db1.mdb.

If you compact a database using the same name, Microsoft Access creates a new compacted database and then deletes the original datbase. In this case, however, the original database wasn't deleted because it is read-only.

If you can, remove the read-only status, delete the origianl, and then rename the original name. If you can't remove the read-only status, inform your workgroup administrator."




I have not made any changes to this database or the properties of it. I keep renaming db1 to the original name because it deletes the original.

Any clues on what might be happening?

I just checked and the databases are not read only.
 
Last edited:

hughess7

Registered User.
Local time
Today, 13:19
Joined
Dec 2, 2010
Messages
27
This problem has literally just started to happen to me too on databases we've used for years, seems to do on some but not all or intermittently anyway. Any ideas please???
 

boblarson

Smeghead
Local time
Today, 05:19
Joined
Jan 12, 2001
Messages
32,059
Check with yout IT folks to see that your permissions have not changed on the folder where the database is. You need read/write/delete permissions. Is this a split database (backend - tables only and on server and frontend copy for everyone on each of their machines)?

Also, which version are you using (including Service Pack level)?

And one last thing to try. Try Decompiling the database. See here for how.
 

hughess7

Registered User.
Local time
Today, 13:19
Joined
Dec 2, 2010
Messages
27
Hi Bob, thanks for the reply! I am IT and no permissions have changed, we have LOTS of access databases and it does this on most of them. We use Office 2003 Pro SP3 on terminal services. Some of the databases are split but some it fails on are just used as transfer files so they are very small MDB's which only contain a few tables and reside on the C drive of the server (due to being used also on standalone laptops). Funnily enough if I move the MDB to our other server it will compact and repair without error so it seems to be the server itself with some fault causing this!
 

boblarson

Smeghead
Local time
Today, 05:19
Joined
Jan 12, 2001
Messages
32,059
Funnily enough if I move the MDB to our other server it will compact and repair without error so it seems to be the server itself with some fault causing this!

Just starting from scratch here -

When compacting the database actually makes a copy of itself and it is named db1.mdb or db1.accdb depending on the version you are using and the file type. It then deletes the old one and renames the db1 back to the original name. If it works on one server and not on the other then there is some security setting that is keeping it from renaming the new one.
 

hughess7

Registered User.
Local time
Today, 13:19
Joined
Dec 2, 2010
Messages
27
Yes it works fine on the other server (used mainly for Exchange server), creates db1.mdb, deletes original and then renames db1 to orginal in the usual manner. BUT on our data server it created db1, deletes original and then errors that the file was read only so it can not delete it - basically same error msg as beginning of this post. But it does delete it? It just doesn't rename db1 back to the orginal filename and it has compacted because file size is reduced.

It is not permissions though because I have checked these (and also other IT people checked too), plus it just suddenly started doing this last week when nothing has changed in terms of permissions. You can manually delete, create or all the usual transactions on these files/folders which you wouldn't be able to do if it was a permissions problem. We have had several issues though, cutepdf stopped working also so I think it is some corruption in the registry or something causing us issues on this server. I just wondered if anyone else had seen this problem and managed to rectify it...
 

BillMarsden

New member
Local time
Today, 05:19
Joined
Apr 26, 2011
Messages
2
I am experiencing a very similar (the same?) problem. Several people use a copy of an Access mdb file on their local systems. We have one user who gets the same error message when compacting the database, both compact on close and through the menus. A few people (including the one with the problem) are using MS-Access 2010 on Win 7. There are several people still using MS-Access 2003 on Win XP. Anyone have a suggestion?
 

pndoran

New member
Local time
Today, 07:19
Joined
Jan 10, 2012
Messages
1
I am have the exact same problem, this just started happening and is intermittent. All of our databases still use Access 2003 on Windows XP. Was anyone able to solve the issue? If so, what was the resolution?
 

BillMarsden

New member
Local time
Today, 05:19
Joined
Apr 26, 2011
Messages
2
Re: Compact and Repair error (Resolved, at least in my case)

My company started using Symantec NetBackup Desktop Agent. This program will automatically backup files (to the network) that are located in selected directories when it senses a new data file and/or a new copy of an existing file. The Desktop (and the 'My Documents' tree) happens to be one of those selected directories. Now, if a user works with an mdb file (MS Access database) on the desktop, and if that file is set to compact on close, then when you close the database a db1.mdb file is created. This starts the Symantec NetBackup (which actually copies db1.mdb to the temp directory before copying it across the network) but it doesn't always start instantaneously hence the problem is at least somewhat intermittent. If the compacting finishes before the copy of db1.mdb to the temp directory completes, the MS Access program will delete the original database and try to rename db1.mdb, but it can't because it is being copied. All we are left with is db1.mdb - most users wouldn't (nor should they have to) understand that this is actually the database that they want.

The work around that we have instituted is: don't work with Access database files on the desktop (or in the My Documents folder tree).
 

Tomatillo

New member
Local time
Today, 08:19
Joined
Jun 6, 2012
Messages
1
:banghead:

Bob, I've hit a brick wall with this same issue. XP, SP3. 2010 Runtime, SP1. Intermittent on the same machine. Document is in a folder off of My Documents. Exact behavior described here. System isn't networked. User is Admin. WIDE open. AV=Security Essentials. Help!

Check with yout IT folks to see that your permissions have not changed on the folder where the database is. You need read/write/delete permissions. Is this a split database (backend - tables only and on server and frontend copy for everyone on each of their machines)?
 

0746

New member
Local time
Today, 05:19
Joined
Oct 9, 2012
Messages
1
I develop using access 2010 and had similar issues on Win 7 machines about every tenth install on user’s machines. A quick fix is set the folder to “Shared” open the application close it then set it back to what it was before (back end database).
There are known issues regarding compacting/repairing when it’s utilised with the on_close event and it’s recommended not to do this. It’s on the Microsoft’s site somewhere but strangely I can’t locate it today.
 

RainLover

VIP From a land downunder
Local time
Today, 22:19
Joined
Jan 5, 2009
Messages
5,041
Go back to Bob's suggestion and decompile the Back End. Don't forget to recompile when finished.

Bob has posted a Link on how to do this. I have not looked but Bob is usually correct.

EDIT

The back end should only contain Tables. If there is and code, forms, reports or queries then delete them before the decompile.
 

Users who are viewing this thread

Top Bottom