Question Force Access 2010 Database Shutdown (1 Viewer)

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
I really need your help. I have searched the forum but couldn't find a thread on this. I have a FE and BE database in Access 2010 and several times I want to force all users to log off so I can perform changes, compact and repair, etc.
I found a post on it in Microsoft but it is not working for me as the chkfile.ozx is not changed and the database keeps shutting down, I am not sure why but that one would work perfectly for me.

Can anyone help me? I'm looking forward to it.

Thank you in advance.
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Hello Gina,

Thanks a lot for your reply.
I had seen this template last Monday while searching for a resolution to my issue. I know I have to indicate a linked table on the BE database instead of tblcity and I did it. However, now I believe I will need a log in form in order to show who is logged in on this database administration form.
I have one in my current database but it doesn't show me who is logged in, it only checks if password and log in are entered correctly so the user can open the database and that's it.
Can you help me with that as well? Really appreciated.

Best regards,
 

GinaWhipp

AWF VIP
Local time
Today, 12:18
Joined
Jun 21, 2011
Messages
5,899
You really don't need a log in form to capture who's in the database, you can just capture the Network log ons, if the is sufficient. A few questions...

Is your database split?
Does everyone open their own front end on their own machine?
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Thanks once again.
Actually the database has not started being used already but it is on the implementation plan of my company for being approved to be used on construction yards. I understand now what you explained, once it is on network it will capture the log ons and that's pretty much what I need.
The database is split and everyone will open their own front end...
 

GinaWhipp

AWF VIP
Local time
Today, 12:18
Joined
Jun 21, 2011
Messages
5,899
That is correct and we'll be here should you run into any problems!
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Hello Gina,

Just one more for now...
I will not be present all the time at the place the database will be used so I thought about writing a vba for creating a backup once a week in a certain folder. Can you help me with that? Thanks.
 

GinaWhipp

AWF VIP
Local time
Today, 12:18
Joined
Jun 21, 2011
Messages
5,899
This is NOT a good idea. You will never know when everyone is out and trying to back-up if someone is in it will cause corruption. The backend should be sitting on a Server. The Server is backed up or is it?
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Need your help, please!
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?
I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]

Please help me. Thank you in advance.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:18
Joined
Feb 28, 2001
Messages
27,317
Just an observation, but your second question (about the frm002_PAF) deserves its own post. I won't address that question in this thread.

As to the issues you suggested in your first post, here is the way I do this.

Setup: FE/BE database, BE shared via network shared drive. FE's copied all over the place. I sometimes have to shut it down or at least make it painful for the users to come in. I sometimes have to track down users, too.

At least a partial solution is this:

I roll my own security based on knowing the user's identity by querying the domain to say "Who is this schlump?" I get back an ID that depends on the user's domain-based login (so it is harder to fake/impersonate). The name is used to look up the user in the tUSR table that contains the user's role. When the user brings up the FE and connects via my master form (a type of switchboard that never goes away), I look up the person and log their presense in an audit log (tEVT). I also update the "last login time" and "in the database" fields in tUSR. When the user logs out, I update the "in the database" field in tUSR because the master form has stayed open in the background. The form's OnClose event handles that update.

How do you know who is in the database? Do a query on the "In the Database" flags to see who is still there. You can also look at the .LDB file using IE to translate it. The workstation names will be enumerated. As it happens, when my users log in, I also store their workstation names, so it is a trivial lookup to identify them. Hint: Look at the Environment functions to identify username and workstation.

Now, here's how you shut it down. As part of the scheduled-events table (tSCHED) I can put in an event with a code that says "database will be down for maintenance" and I can put a start and stop date/time on that event. So... when an event needs to be scheduled, I have a form to add an event with a "down-time" flag, a start time, a stop time, and a description. The form enforces that the stop time MUST be in the future though the start time does not also have to be in the future.

Part A - when a user logs in via the master form, that form looks at the tSCHED table to find the earliest event with a stop time still in the future. If the time is between the start and stop times of a "down" event, the user is told "Sorry, database not available, try again after <event stop time>" - and the master form does an Application.Quit

Part B - remember that I said the master form doesn't go away? In the background, the master form runs a timer and using the OnTimer event, checks for the event with the earliest start and stop times where the stop time is still in the future. (The query isn't that complex, really). If the timer code sees that the current time is between the start and stop times for a down-time event, it immediately does a timed message box with an "OK Only" type of button layout. The OnTimer event then triggers the master form to shut down the application. You need a timed box so the user can't just refuse to acknowledge it. I do an enumeration of the "Forms" and "Reports" collections to see what open items need to be shut down, do a forced shutdown on each of them, and then shut down the app. The users never see the database navigation pane, so I have at least that much control over what they can do.

Clunky? Yes. Works? Yes. Wish it were easier? HELL yes. Lots of work to maintain the required tables, timers, and infrastructure? You know it is. But it is "the cost of doing that kind of business."
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Hello Doc,
Thanks for the reply. Actually Gina has helped me on that. I have a form and also hidden forms enabling me to see who is online, that's quite useful. I can shut down one by one or all at once with a private or public message.
Actually I used the old thread for a new one... Thanks anyway. Cheers.
 

GinaWhipp

AWF VIP
Local time
Today, 12:18
Joined
Jun 21, 2011
Messages
5,899
:confused:

Did you start a new thread or was your question answered?
 

gstreichan

Registered User.
Local time
Today, 18:18
Joined
Apr 1, 2014
Messages
29
Hello Gina :)

I have started a new thread... still have no answer on it.

Please help me. I am very close to it but not there yet...

Tried sending the thread but can't... can you find it?

Thanks.
 

GinaWhipp

AWF VIP
Local time
Today, 12:18
Joined
Jun 21, 2011
Messages
5,899
Hmm, what did you name the new thread, I can't find it :(
 

Users who are viewing this thread

Top Bottom