Is it possible to \"compact and repair\" an Access database programmatically somehow (using ADOX, using OleDbConnection etc.)?
it'possible compacting and repairing an MS ACCESS database in two ways:
RepairDatabase()
, while in DAO360 there's CompactDatabase()
As an example, in VB6 (old, old, old...) do this:
Dim jro As jro.JetEngine
Set jro = New jro.JetEngine
jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db_to_repair.mdb;Jet OLEDB:Database Password=mypass", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\repaired_db.mdb;Jet OLEDB:Engine Type=4;Jet OLEDB:Database Password=mypass"
As you will notice, the function requires that you specify the name of the db to be repaired and the name of the repaired database.