exclusive access issue

bone head

Registered User.
Local time
Today, 22:25
Joined
Feb 11, 2002
Messages
73
I have been developing a database with the help of many from these forums, this is now operational and data inputted from 9 locations.

My nightmare now is caused by not being able to get exclusive access to modify the database which is still developing.

This is caused by people not logging off when asked etc.

Is there any way of overriding this or causing it to crash or something so I can get access. Was thinking if it was possible to create a bit of code which closes access at a given time, would that be possible

Any thoughts gratefully received


Paul
 
Actually if you have this in 9 different locations then you should have a backend on the server that everybody is accessing and a front on at each of the 9 locations.

If this is so then you should be able to open access and modify your copy (presumably the master copy) then redistribute your copy as needed
 
You are correct in that if your users are not very well disciplined, you can have nightmares getting them to log off so you can have exclusive access.

The way I would approach this is based on having a startup form that kicks off when they open the .MDB file. Create this form, let them click "OK" or something to close it. But... don't close it. Instead, minimize it and make it invisible - but still resident.

Now, inside this form, put two more things. First, when you click that OK button, set the Me.TimerInterval to something large, like 60000. The units are milliseconds and it is a LONG, so you can put in some big numbers.

That number I gave you would be equivalent to a timer tick one minute after the time the OK is clicked. At that point, the second item becomes important.

Add a Form_Timer event routine that wakes up once every timer event. If it isn't the shut-down time, reload the timer with the same number. But if it IS the shut-down time, instead do a

DoCmd.Quit

Now, all that is left is to decide the rules for shutdown. At worst, this will require two functions: Hour() and Minute(), which return the hour of the day, midnight=0; and minutes past the hour.

So let's say you get the database at 6:30 PM -

If (Hour() >17) And (Minute() > 29) Then
DoCmd.Quit
Else
Me.TimerInterval = 60000
End If

That should turn the trick.
 
I have done someting quite differant but somewhat the same. I have a form that loads at startup and automatilly hides. On this form there is a timer that runs every few minutes. I have done it a few differant ways but the jist of it is it checks a record in a linked table to see if it is "yes". I can then at my computer change the field in the table to a yes and it will knock everyone out of the database. I have 40 or more people in multiple databases and it would be impossible to make every one get out consistantly. This way I can knock them out when ever I want.


sam
 
pono1, I like that idea better than mine. Mine works 99.9% of the time but I did run into a problem where the database that has the table in became corrupt(happened once so far). I could not get into it to log the people out.

sam
 
Sam -- I guess I didn't read your post thoroughly since I thought that was your solution. Happy to be of help. Note: The_Doc_Man's solution is, of course, perfectly fine too.

Tim
 
Many Thanks for the advise I think I need to go down the road of Sams and Autongs suggestions, as different sites are working different hours etc.

I Downloaded from the link in Auotongs message, however can not seem to quite get my head round what to do with the files.

Have also come across a problem with DAO I am using Access 2000 and according to the info on the link site it should be as simple as going to tools –references and clicking on Dao 3.6, however can not find a section for references, could this be because I am on a mainframe system and this may have been disabled, I know various functions occasionally have been in other programmes for security reasons.

I have a form to open all other forms in the data base called main menu

have attached the download from Auotongs message

If anyone would care to have a look and help me out, would be most grateful

Many thanks in advance

Paul
 

Attachments

Last edited:
You have the wrong file selected. Here is the one to log users off for A2K. http://www.rogersaccesslibrary.com/download2k.asp?SampleName='LogUsersOff2k.mdb'

It sounds as you have limited experience working with "coding" and VBA in Access. If you look at the forms properties there is a timer event. Click to the right of Event Procedure (doesn't look like there is anything there but when you click there 3 little dots will appear (...) which will take you to the VBA (Visual Basic for Access) interface. Here you can set references (Tool - References) and change / add code to event procedures. The description of the sample pretty much tells you how it works.

If you need further help post back and we'll get you thru it.

Autoeng
 
Oops i posted the wrong ZIP Sorry.

yes I am a bit in the dark about coding etc and have stumbled along to date, with quite a lot of help from people in here.

what i am not to sure about is when i unzip the ( correct) Zip it contains two databases, which do not appear to be linked, what do i do with them link them to my database somehow or, what i started to do was to import the details into my database. however that is when i got the Dao problem and cant seem to install Dao 3.6 as a the website says

thanks for your patience

Paul
 
No problem. His example is meant to illustrate the application in a front end / back end setup. This is how your db should be if you have it used in 9 locations as indicated.

Have you gotten to the VBA interface to see if you can find "Microsoft DAO 3.6 Object Library"? You can browse to its location at C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.dll.

After downloading you will run the file without the be ending. You will get an error. Select Tools - Database Utilities - Linked Table Manager. Click the only file in the window and click "Always Prompt For New Location" in the lower left corner. Select OK. Point to the directory where you put the back end.

OK now tell me where you are lost from this point on.

Autoeng
 

Users who are viewing this thread

Back
Top Bottom