Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro for Compact and Repair Database

Status
Not open for further replies.

beti

Programmer
Oct 6, 2002
26
US
Ah friends,

Is there a way in Macro where I can create a function to Compact and Repair the database?
I know you can find this function from Data Utilities but I wanna to do you it automatically everytime when user exit the application.

Please help!!

Thanks
 
The problem here is that in Access 97 & 2000 the menu option to Compact Database cannot be duplicated from code. Jet requires that the database to be closed before any compact procedures are run. However, there is a utility that you cna use which will close the database, compact it and then re-open the database. You can read more about this by visiting
 
I just completed a sample databse for Access 97 that uses another small database to do this....You open the new database from your current one, close the current one, the new one does the compacting, and then reopens the current one back for you and closes itself....send an email to my address in my sig block and I will forward it out to you.... Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top