Hi,
try to make a copy first, and then Compact a copy
--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
"Phil Freihofner" <(E-Mail Removed)> wrote in
message news:341A6A68-A359-49C2-9AAB-(E-Mail Removed)...
> I ran the following line of code from a db, called "writer.db".
>
> Application.CompactRepair "projecttrack.mdb", "db1.mdb", True
>
> It worked great, creating both the "db1.mdb" file and a log file.
>
> I erased the db1.mdb & the log file, and tried to run it again, and it
> failed, giving the following error:
>
> "Runtime error 7866.
> Microsoft cannot open the database because it is missing or opened
> exclusively by another user."
>
> I've closed all my copies of Access and reopened them, tried running again
> and get the same error. The applications are on my desktop computer--no
> one
> else could possibly be using them. Why did it work once then stop working?
>
> Many thanks,
>
> Phil Freihofner