Compacting/repairing

Atomic Shrimp

Humanoid lifeform
Local time
Today, 10:13
Joined
Jun 16, 2000
Messages
1,954
I have a large database that contains an Autoexec macro.

Whenever I compact or repair the database, it launches the macro afterwards, which is not always convenient.

I know I stop it by sitting there with my finger on the shift key, but the database takes 10 minutes to compact, is there another way to suppress the macro? (other than temporarily renaming it, I suppose)

Mike

[This message has been edited by Mike Gurman (edited 03-12-2001).]
 
Look into an application property called UserControl (ac2000, not sure about 97). It returns true if the application was launched by a user, false otherwise.

I need to deal with that issue sometime soon too. Let me know if it works out.

good luck,
norm
 
If you choose the option to automatically compact/repair when closing the DB, I don t see why/how the autoexec macro should trigger.
 
I didn't know there was such an option Alexandre, where can I find it?

(I'm also not sure why I posted this question in the Reports forum....hmmmmm)

Thanks

Mike
 
A2k: Tools, Options, general,
I think I read somewhere that is was nez feature of A2k. So, If you don t use A2k I beleieve that you can programatically launch the compactation on closure of the DB.

Another solution is to compact the DB zithout opening it: just open a new access session, tools, db utilities (might not be the right translation: I am using a French version), compact database. You ll be prompted to inicae the path.
 
A2k: Tools, Options, general,
I think I read somewhere that is was new feature of A2k. So, If you don t use A2k I beleieve that you can programatically launch the compactation on closure of the DB.

Another solution is to compact the DB zithout opening it: just open a new access session, tools, db utilities (might not be the right translation: I am using a French version), compact database. You ll be prompted to inicae the path.
 
BTW, SendKeys "%(TDC)", False
befor application.quit, or the quit command in a macro, should do it.
 
Thanks.

I do have A2K, but by preference I'm still using 97.

It says in the online help that you can't programmatically compact or repair a database from within itself.

I suppose I could get the database to launch another one on exit and have that one perform the compact/repair.

Mike
 
In this case, it will be simpler to Compact the Db without opening it, unless you need to get it really automatized...
 
BTW again, as far as I know, CompactDatabase is not a new A2K method. And it can compact the current DB by making automatically a copy of it (see help on the subject).
 
Thanks

As the database resides on the server I think I'll make it a scheduled task to run in the middle of the night.

one final question:

I think I should repair first then compact, is this correct?

Mike
 
In A2K CompactDatabase both repairs and compacts. In A97 I don t know. You certainly must repair before compacting or you will generally get an error if the database is corrupted (=unless Access isn t able to detect the corruption by himself).

The only option you should not take would be to repair a database before closing it: generally useless since most of the corruption cases occur when databases are not closed properly.
 
In A2K CompactDatabase both repairs and compacts. In A97 I don t know. You certainly must repair before compacting or you will generally get an error if the database is corrupted (=unless Access isn t able to detect the corruption by itself).

The only option you should not take would be to repair a database before closing it: generally useless since most of the corruption cases occur when databases are not closed properly.
 
Thanks Peter, that's a great help.

I've tested it, and it seems to work very nicely, but keeps prompting regarding updating rows, I think this is because you've used RunSQL and I don't have the warnings turned off by default on my machine.
 

Users who are viewing this thread

Back
Top Bottom