views:

579

answers:

1

How can I call Access's Compact and Repair Database utility from within C++? I'm already using ADO and ADOX, so a solution using either of those would be handy.

+2  A: 

Similiar to:

How can I programmatically repair (not merely compact) an Access .mdb file?

You can do this using COM to access the JRO.JetEngine object. There is an example in C# at CodeProject which shouldn't be too hard to convert to C++.

UPDATE: Thanks to @le dorfier, here is an article with C++ example.

Mitch Wheat
Yes, I saw that one there - however, I am asking about a C++ solution, which neither that question, nor any of the answers seemed to address.
Smashery
Here's the same thing for C++http://support.microsoft.com/kb/230501found with googling "c++ JRO.JetEngine"
le dorfier
@le dorfier: nice find! that one elluded me! :)
Mitch Wheat
Any ideas on how to compact and repair an Access 2007 .accdb database file by code?
TheAgent