You may want to try to open an exclusive connection to the database. If it fails, it cannot be compacted. In either way, you will need to trap the error.
>Thanks for the KB.
>
>But now i'm having a situation, because my app is multi-user and sometimes access leave the .ldb file opened even if it's not been used.
>
>How can i know when the database is really opened?.
>
>Thanks in advance.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com