Re: compacting database

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



There is the MoveFile Method.

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Jason" <JAllen@xxxxxxxxxxx> wrote in message
news:OrVCuEbMJHA.5780@xxxxxxxxxxxxxxxxxxxxxxx
are you sure it is name as this is usually Form.name:
did f1 on name and found that it is supposed to be as instead of comma/

Is there facility to move also?
Thanks,
Arvin Meyer [MVP]" <arvinm@xxxxxxxxxxxx> wrote in message
news:OyF8vwaMJHA.740@xxxxxxxxxxxxxxxxxxxxxxx
The Kill statement will delete the old file.

Kill "F:\yourdir\oldname.mdb",

The Name statement will rename a file:

Name "F:\yourdir\newname.mdb", "F:\yourdir\oldname.mdb"
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Jason" <JAllen@xxxxxxxxxxx> wrote in message
news:OZGOH6YMJHA.6000@xxxxxxxxxxxxxxxxxxxxxxx
How do I delete the existing mdb file and rename the compacted file
within access?

Thanks,
J.
"Arvin Meyer [MVP]" <arvinm@xxxxxxxxxxxx> wrote in message
news:eCZD8TNMJHA.5780@xxxxxxxxxxxxxxxxxxxxxxx
"Jason" <JAllen@xxxxxxxxxxx> wrote in message
news:OjMX2oMMJHA.1736@xxxxxxxxxxxxxxxxxxxxxxx
Someone posted about compacting a backend file from within the front
end. I have had at least a 99% failure rate doing it this way.
However, using Tools - compact works but is a manual task.

Have you tried:

DBEngine.CompactDatabase "F:\yourdir\oldname.mdb",
"F:\yourdir\newname.mdb",

or to the same name:

DBEngine.CompactDatabase "F:\yourdir\oldname.mdb",
"F:\yourdir\oldname.mdb"
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com









.