A
ali
I need to create a button which will run :
Tools--> Database Utilities --> Compact and Repair Databases...
Tools--> Database Utilities --> Compact and Repair Databases...
(...)You cannot programmatically compact the current database, because the shut
down for compact cannot occur while the code is running.
You cannot programmatically compact the current database, because
the shut down for compact cannot occur while the code is running.
Microsoft even provides a way to do it:
RunCommand acCmdCompactDatabase
but it can't work for the reason explained above.
You can try stuffing keystrokes into the keyboard buffer with
SendKeys. I've no idea if that's possible, but I could not
recommend it. That key sequence could do something undesirable in
a future version of Access.
ali said:I need to create a button which will run :
Tools--> Database Utilities --> Compact and Repair Databases...
Krzysztof Pozorek said:(...)
(...)
This is truth, but this is not whole truth ;-) Following VBA code compacts
current database:
CommandBars.FindControl(id:=2071).accDoDefaultAction
Douglas J. Steele said:You might consider changing how your application works.
From the sounds of it, you're importing data into temporary tables in your
front-end, thus causing the bloating. Instead, import into temporary tables
in a temporary database. Tony Toews has sample code at
http://www.granite.ab.ca/access/temptables.htm
Jeff C said:--
Jeff C
Live Well .. Be Happy In All You Do
The database and process is one built for another and myself to generate
monthly reports. I didn't see the need to split it, but am re-thinking now
that you have pointed out Tony's idea - I like that and working through the
process will help me with other things.
Thanks much for your thoughts - "Salute" Doug