Problems with Compacting via command line

J

J

I'm using Task Scheduler to run a number of compacting tasks on MS
Access databases:

Here's an example command line:

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
"\\ATGSVR3\Corp\Inventory.mdb" /compact

I do this for 6 databases and 4 are compacting w/o issues while 2 error
out with the following error:

===================
Microsoft Office Access can't delete \\ATGSVR3\Corp\Inventory.mdb after
compacting it. The compacted database has been named
\\ATGSVR3\Corp\db1.mdb

If you compact a database using the same name, Microsoft Office Access
creates a new compacted database and deletes the original. 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 original database
and then rename the new database using the original name. If you can't
remove the read-only status, inform your workgroup administrator.
====================

Even for the 2 databases that error out, they error out sproadically
(although it is more common for the command to error out rather than
complete successfully.

Any thoughts? I have checked for read-only status and all files are
read/write.
 
S

Sharkbyte

Is it possible that someone is leaving the db(s) open, on their desktop? In
such a scenario, Microsoft would view the file as Read Only, since the Delete
command would fail.

Not knowing what version of Access you are using, there have also been
historical issues with improper shutdown leaving locking files (.ldb) in
place.

Good luck.

Sharkbyte
 
J

J

I am making sure no one else is in the database. I set the databases
to compact after everyone leaves the office.

If I choose to compact and repair by opening Access and manually
choosing from the Tools tab, everything works fine. Only errors when I
initiate from the command line. It's very odd...

For the record I am using MS Access 2000.

Still accepting any ideas...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top