How do i create a button to Compact & Repair?

T

TORQUE

Hello there,

Is there anyone who can help me out with this question.
How do i create a button to Compact & Repair?

Any help with this matter would be greatly appreciated.

TIA
TORQUE
Mar. 23, 2007



--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
 
J

John W. Vinson

Is there anyone who can help me out with this question.
How do i create a button to Compact & Repair?

I rather doubt that you can.

Compaction works by creating a new, empty database; copying everything from
the current database into it; deleting the old database, and renaming the new
one.

It's pretty hard to see user code surviving that transition!

I'll often have a shortcut (on the desktop for frequently used databases, in
the database folder for others) using the /Compact switch to compact the
database "from outside".

John W. Vinson [MVP]
 
E

engles

I rather doubt that you can.

Compaction works by creating a new, empty database; copying everything from
the current database into it; deleting the old database, and renaming the new
one.

It's pretty hard to see user code surviving that transition!

I'll often have a shortcut (on the desktop for frequently used databases, in
the database folder for others) using the /Compact switch to compact the
database "from outside".

John W. Vinson [MVP]

The only thing to add to what John has said is that you can write code
to repair and compact any database except the one you currently have
open. Look up CompactDatabase in help. I use this to compact and
repair linked databases. Before Access 2000 (I think that is when it
switched), you also had to call RepairDatabase, but now they are
combined.

-- Larry Engles
 
D

Douglas J. Steele

The only thing to add to what John has said is that you can write code
to repair and compact any database except the one you currently have
open. Look up CompactDatabase in help. I use this to compact and
repair linked databases. Before Access 2000 (I think that is when it
switched), you also had to call RepairDatabase, but now they are
combined.

Actually, it is possible to compact the current database, at least in Access
2000 and Access 2003 (sorry, I don't have Access 2002 handy, so I can't
check it, nor have I checked Access 2007).

See http://www.mvps.org/access/general/gen0041.htm at "The Access Web"
 
E

engles

Actually, it is possible to compact the current database, at least in Access
2000 and Access 2003 (sorry, I don't have Access 2002 handy, so I can't
check it, nor have I checked Access 2007).

Seehttp://www.mvps.org/access/general/gen0041.htmat "The Access Web"

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)- Hide quoted text -

- Show quoted text -
From code? I don't believe so, but maybe I have something to learn
here. I get error 70 (permission denied) when I try. And that
matches past experience. I've used CompactMdb which puts the database
right back with the same name.
 

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