Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dbc
Message
From
20/01/2007 18:54:17
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Re: Dbc
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows Server 2003
Network:
Windows NT
Miscellaneous
Thread ID:
01187446
Message ID:
01187455
Views:
15
>I have users who leave the VFP application running over weekend and I need to run a cleanup routine which requires exclusive use of the .dbc file. I tried using the command set database to (database), but to no avail.

>If anyone has any suggestions please let me know. My second question, is there a way that would allow me to close the vfp application if it detect no activity for let's say three hours?

I have used the following to manage updates to the program code and database/tables. The application when it starts checks for the existence of a shutdown.log file located on the server with the database tables. If this file is present, the application informs the user that maintenance is being performed and then shuts itself down. If the file is not present, then the program starts a timer object that checks for the existence of this file in the Timer() event method code. If the timer finds the file, then it informs the user that the application will be shutdown in five minutes (arbitrary amount of time -- you can decide the time limit) to allow the user to finish their work and quit the program. This timer then starts a second timer object to shutdown the application in the specified time limit (you can give further warnings if desired).

This now allows you to remotely shutdown all running instances of the program. Once you are finished with table maintenance, delete the shutdown.log file -- now users can work again.

As for shutting down in say 3hrs -- this is hard. What if the user is constantly working for more than 3hrs (how to detect this)? Do you shutdown anyway? Using the above is safer and easier. Also, to protect tables, I don't open tables with the start of the application; only open those tables that are specific to a particular form (in the form's DE).
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform