I found in this forum how to compact an Access database using ADO. It uses the CompactDatabase method of a JRO.JetEngine object.

Here is the line I am getting an error on:
Code:
JRO.CompactDatabase "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\VB Projects\CD400\CD400.mdb;" _
    & "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=C:\TEMP\temp.mdb;Jet OLEDB:Engine Type=4"
I am getting the error number 3251: "Object or provider is not capable of performing requested operation."

What am I doing wrong ? Does anyone know how to do this ?

Thanks !