Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
First person in the store
Message
 
To
30/04/2008 01:18:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01314068
Message ID:
01314142
Views:
7
Are you trying to run something once a day, and it doesn't matter who is the first person to do it, just make sure it gets done?

If so, this is what I've one in the past.
When the app runs, it checks a file that all that is in it is the last date that the application was run. I read this file in, compare it to today, and then if it is not today, I run the code that I want to run everyday. I then write todays date to the file when I'm done. Thus, the next person in will not run the code, as it has been already run.

The beauty of this, it also allows forced runs during the day... i.e. Change the date in the text file, and run it again and it will update what ever you want to.

I've used this in a startup program to check if there has been updates to the mian application and to download the updates to the users machine. I've used this to run reindex routines daily, etc.

HTH,
Mike




>>in the multi-users environment, is there anyway to know I'm the first login-er?
>>
>>the point is, I have to run a procedure at the beginning of the day, and I want it to run automatically, and it only runs once for a day. I don't want another person login and repeat that procedure.
>
>If a computer is left running overnight, you could schedule your procedure to run at some early time like 03:00 (perhaps either before or after any backups are scheduled to run/complete). You could also set up a user account to run that job, and set up privileges so that only that user account has access to the procedure, so no-one else would be able to run it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform