compact a backend database from a button on the frontend form

S

SteveD

you can with some code, as long as the link is not an
active/open link to it (like connected to your form).

Using code to compact, you will compact it to another
name, then delete the original file, and rename/copy the
compacted one back to the original.

to copy a file use: FileCopy 'FROM' 'TO'

to Delete: Kill 'path & file name'

to compact: DBEngine.CompactDatabase 'FROM', 'TO'

Note: the FROM and TO includes the path & file name as a
string.

I use this concept to create a back-up of the data(back-
end) & to compact the data when the user(single) exits. I
add a timestamp to the back-up file. It works out pretty
slick.

need more to get you going?, just ask.

SteveD


-----Original Message-----
I have a front end database with forms and reports
linking to 3 separate backend files. One of those files
is used for regular import, delete and re-import of large
data tables. This means the file gets huge.
Is there a way I can have a button on the form in the
front-end database that can compact the back-end database
file on the fly. My only solution right now is manual
compacting it regularlly.
 

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