MS-Access 2003 running security with individual logins. How do I force all users to log off?
Thanks!
MS-Access 2003 running security with individual logins. How do I force all users to log off?
Thanks!
I open a hidden form in my main database (that stays open as long as the database is open) when the user first logs in, with a timer event that fires every 30 sec or so. When the event fires, a value is checked in a lookup table (Yes/No data field) that I can toggle with an update query against the table. If the value is found to be TRUE, then a warning message is displayed to the user (on a timed form which automatically closes after 30 seconds - prevents me from having to wait until the user clicks "OK" on a standard message box) and the app is then closed. If the user tries to reopen and the value is still set to true, then the user is warned and the database is immediately closed.
I use this when I need to make updates - I toggle the value, wait 30-45 sec until all users are thrown out, make my updates, and then toggle the value back, allowing users to log in once more. Works great for me, I have been using this method for two years now on a database I maintain without problems.
I actually have an "update" function that I run in a duplicate development database on my local hard drive. It pops up a form listing all the forms, modules, queries, etc and let's me select which ones I have updated, then sets the toggle value in the lookup table, waits until the ldb locking file is gone by looping a dir function on the server directory where the main database resides. When the Dir function returns a null string (indicating that all users are out), then the function copies all the changed forms, modules, etc from my development database to the main database and resets the toggle value allowing users to log back in. All I have to do is run the update macro which opens a form, click the stuff I need to update, click "GO" and sit back and wait until updates are made. Once I got it written it sure saved me a lot of time when making updates. I have attached a sample you can cannibalize if you want . Once you run the macro it loads the form listing all of your components. Check to ones you want to update and click GO. I think all the code is pretty simple to follow.
Thanks for the info. I'm still a novice with Access and could not reverse engineer your code so I understood it. Is there a more simple way to skin this cat?
Much Thanks!
Yes - get up from your chair and go around to each of your users and say, "please log off". Short of that, your going to have to learn a bit of VBA. The code I sent you is VERY basic and about as simple as I've seen, so sorry, I can't point you to a simpler solution.
I wouldn't recommend any type of coding which automatically logs off or closes an mdb. This can lead to data corruption should a user be in the midst of editing a record.
See here for an ideal solution which works very nicely:
http://www.dbforums.com/6274786-post19.html
Many many thanks to you brother, I will try it.-Masum. Oh sorry brother, it does not work.I open a hidden form in my main database (that stays open as long as the database is open) when the user first logs in, with a timer event that fires every 30 sec or so. When the event fires, a value is checked in a lookup table (Yes/No data field) that I can toggle with an update query against the table. If the value is found to be TRUE, then a warning message is displayed to the user (on a timed form which automatically closes after 30 seconds - prevents me from having to wait until the user clicks "OK" on a standard message box) and the app is then closed. If the user tries to reopen and the value is still set to true, then the user is warned and the database is immediately closed.
I use this when I need to make updates - I toggle the value, wait 30-45 sec until all users are thrown out, make my updates, and then toggle the value back, allowing users to log in once more. Works great for me, I have been using this method for two years now on a database I maintain without problems.
I actually have an "update" function that I run in a duplicate development database on my local hard drive. It pops up a form listing all the forms, modules, queries, etc and let's me select which ones I have updated, then sets the toggle value in the lookup table, waits until the ldb locking file is gone by looping a dir function on the server directory where the main database resides. When the Dir function returns a null string (indicating that all users are out), then the function copies all the changed forms, modules, etc from my development database to the main database and resets the toggle value allowing users to log back in. All I have to do is run the update macro which opens a form, click the stuff I need to update, click "GO" and sit back and wait until updates are made. Once I got it written it sure saved me a lot of time when making updates. I have attached a sample you can cannibalize if you want . Once you run the macro it loads the form listing all of your components. Check to ones you want to update and click GO. I think all the code is pretty simple to follow.
I am new user of that sites as well ms access. I collect a sample about my problem. I will try it. Thank you.
I thought it will be very helpfull, but it does not work. bye
Hi! I am totally new (not that new) and not sure exactly what to do with this file. Should I export everything to my DB? If I open yours how long do I wait before it logs me off? + Any reply - a helpful onewould be really appreciated! Thanks again!