Delete DB on Wed AM

travismp

Registered User.
Local time
Today, 19:54
Joined
Oct 15, 2001
Messages
386
OfficeXP
Access 2000

I have an issue where I need all but 2 users out of my DB on Wednesday morning for billing reasons.

I thought of writting a batch file that would delete the frontend DB from all computers from 8:00 - 10:00 every wed morning. However if a user comes in before 8:00 and have the DB open then it will not delete the front end from their desktop.

Can anyone think of a way to keep users out of a system from 8-10am every Wed?


Thanks All.

T
 
If you have a startup form or a splash image, allow that to minimize rather than close. Then put code behind the form that looks at the time of day every so often. Set the Form.Timer to 60000 (units are milliseconds, so this is 60 seconds). In the Form.OnTimer routine, call a common routine to check the time of day and day of week (both available from DatePart() function, q.v.). You can also test for the username if you have workgroup security set up and can see the CurrentUser() or an environment function for the network username. Call this same routine from the Form.OnLoad routine.

If the result of this time check is that the user shouldn't be there, issue a message. Use the timer function to again make it stay up for a shorter amount of time, say 5 seconds. Then do an Application.Quit

I've given the overview. Play with it until you like it, then unleash it on your adoring fans. (If you want anything from them, get it BEFORE you do this to them, because your popularity ratings will plummet.)
 
thanks I see where you are going... I will play with something. There is one form they use to enter data, that is all I truely do not want them to use. I can maybe play around with the time functions and if they open that one form on Wed between 8-10 it might pop up with a message maybe???? great place to start.


right now I have a batch file I wrote that I will install on each computer and schedule to run Tuesday at 4:50.

it looks like this:


@ECHO off

CLS

echo ***WARNING***
echo Please close all open databases.
echo This file will delete your dbname database from your desktop.
echo It will be added back to your desktop at 10:00 Wednesday AM

pause

TASKKILL /F /IM "msaccess.exe"

del "%userprofile%\Desktop\dbname.mdb"
del "%userprofile%\Desktop\dbname.ldb"





This file will first warn them... then kill access... then delete the files left behind if they did not close out. I will then write another file that will recopy the frontend off the server at 10:00.

That will not take too long. I just hope there is a better resolution. Your timer might work well. Thanks.
 

Users who are viewing this thread

Back
Top Bottom