How can I repair and compact a standalone database by macro, or VBA? In other words, how does an Access 2007 standalone database repair and compacts itself through the menu button. I know (and understand why) that the database has to be closed. Just want to know how I can do what Access does by manual interaction?