I'm developing a front/back end database that will run on Windows 2k over a Novell network. Is it possible to conduct database maintenance only when the last user logs out? I suppose I could only worry about each terminal, but I'd feel better if I could do one last check when the last person exits the application. My worst fear is that a temporary table will end up trying to create a duplicate value in a primary key and cause the app to crash.
Originally posted by jmrSudbury
Check if the ldb file exists. If it does, try deleting it in case it is old. If you get an error... it is locked and the mdb is still in use.
Will that work for an application that hase a client side front end? Also, wouldn't deleting the ldb cause an error regardless since the current user is in the system? It seems to me I remember seeing a snippet of code to determine the number of users in a system, but I just forgot where!!! Thanks for the reply. Any other ideas?
You can only conduct backend maintenance when all users are out. If you have a main menu or switchboard always running, you could use a timer event to run code that will check if the programmer/database administrator has set a value in a control table that says KickEveryoneOut. It could keep track of when it was first set and will give the user a message every minute for 5 minutes until it just issues the command docmd.quit. As soon as the ldb files are gone, then everyone is out and the maintenance can be done.