A
Andrew Smith
I am looking for a way to automatically compact and repair the backend
database when a user closes the database and nobody else is using it.
So far I have written a function that does the compact and repair, renames
the original file and then renames the compacted file to the name of the
original file. This works fine from the front end database provided all
bound forms are closed, but obviously it does not work if there are any
forms open. So, I wrote another procedure to close all the forms. Then I had
the code on the applications "quit" button run the form close procedure
followed by the compact procedure, but this fails as the .ldb file is still
there until the code stops running, even though all the forms have been
closed.
Is there any way round this, or do I need to look for a different approach?
Thanks in advance.
database when a user closes the database and nobody else is using it.
So far I have written a function that does the compact and repair, renames
the original file and then renames the compacted file to the name of the
original file. This works fine from the front end database provided all
bound forms are closed, but obviously it does not work if there are any
forms open. So, I wrote another procedure to close all the forms. Then I had
the code on the applications "quit" button run the form close procedure
followed by the compact procedure, but this fails as the .ldb file is still
there until the code stops running, even though all the forms have been
closed.
Is there any way round this, or do I need to look for a different approach?
Thanks in advance.