Why compact from MDE doesn't work??

J

Joey

I am trying to compact my backend db from inside my front end db. I am using
the following code, and it seems to work OK when the database is an .MDB but
when I make the .MDB into and .MDE file, the code errors out because the .MDE
front end has the mde backend open already.
Does anyone know if you can compact in code in an .MDE??
I am beginning to think that I should just check "Compact on Close" (using
Access 2000) Thanks for any ideas.

-----------------------------------------------------------------------------
Function CompactDB(DBSourceName As String) As Boolean
Dim DbDestName As String

DbDestName = Left(DBSourceName, Len(DBSourceName) - 3) & "NEW"
DBEngine.CompactDatabase DBSourceName, DbDestName
Kill DBSourceName
Name DbDestName As DBSourceName
CompactDB= True

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top