UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How Do I Kick Everyone Out Of A Database?, Access 2010    
 
   
smc678
post Dec 23 2013, 04:30 PM
Post#1



Posts: 13
Joined: 23-December 13



Hello All, Is it possible to kick others out of a frontend so I can update the back end?
Go to the top of the page
 
DanielPineault
post Dec 23 2013, 04:46 PM
Post#2


UtterAccess VIP
Posts: 7,346
Joined: 30-June 11



See: http://www.rogersaccesslibrary.com/downloa...LogUsersOff.mdb
Go to the top of the page
 
dahargis
post Dec 23 2013, 04:55 PM
Post#3


Banned
Posts: 633
Joined: 12-January 07



Well, it takes a bit of doing. Here is the concept:
You will need a form that is openin the FE the entire session with a record source to a table in the BE. It can be a one record table. I use a text field I can put a message in.
The timer event should check the value of field each time it fires. If the field has a vaule other than "", then start the shutdown process. I usually allow the users 5 minutes. The time event should look something like this (air code from memory:
dim lngTimeGone as Long
With Me
If lngTimeGone = 0 then
.Requery
If rst!Message <> vbNullString then
.Visible = True
.txtMessage1 = rst!Message
.txtMessage2 = "Application Will Shut Down in 5 minutes.
lngTimeGone = 1
ElseIf lngTimeGone <= 5 Then
lngTimeGone = lngTimeGone + 1
Else
Docmd.Quit
End If
Go to the top of the page
 
smc678
post Dec 24 2013, 10:27 AM
Post#4



Posts: 13
Joined: 23-December 13



So it have a table linked with 1 field. Text box on my switchboard form that always stays open. I placed the VB code AfterUpdate? on that text box? Compile error method or data member not found. highlights the .txtMessage1 any Ideas?
Private Sub Text22_AfterUpdate()
Dim lngTimeGone As Long
With Me
If lngTimeGone = 0 Then
.Requery
If rst!Message <> vbNullString Then
.Visible = True
.txtMessage1 = rst!Message
.txtMessage2 = "Application Will Shut Down in 5 minutes."
lngTimeGone = 1
ElseIf lngTimeGone <= 5 Then
lngTimeGone = lngTimeGone + 1
Else
DoCmd.Quit
End If
End Sub
Go to the top of the page
 
datAdrenaline
post Dec 25 2013, 01:54 PM
Post#5


UtterAccess Editor
Posts: 18,007
Joined: 4-December 03
From: Northern Virginia, USA


An intrinsic way to do it is called "passive shutdown". What you do is set a property on a database file, then with that property set, no NEW connections will be granted. Read more about that here (Connection Control (aka: Passive Shutdown) property )
I have a utility in UA's code archive that tells you who is connected, and lets you manage the Connection Control property. I find it very useful when managing ACE database files. Here is the utility: Who's Connected.
I have often been so successful with using Connection Control / Passive Shutdown, then I don't need to implement something to force others out. But, when I do, I use Connection Control as my "flag" then in a Timer event I read that property, if the property is set, then I shut people down. By using the Connection Control property it keeps things as close to native as possible.
Go to the top of the page
 
dahargis
post Dec 26 2013, 11:46 AM
Post#6


Banned
Posts: 633
Joined: 12-January 07



in the form's Timer event
Go to the top of the page
 
jhcarrell
post Dec 26 2013, 12:18 PM
Post#7



Posts: 573
Joined: 31-October 10
From: Birmingham, Alabama


Thanks for this!
Go to the top of the page
 
datAdrenaline
post Dec 26 2013, 10:37 PM
Post#8


UtterAccess Editor
Posts: 18,007
Joined: 4-December 03
From: Northern Virginia, USA


You are most welcome!
Go to the top of the page
 
DanielPineault
post Dec 31 2013, 08:25 PM
Post#9


UtterAccess VIP
Posts: 7,346
Joined: 30-June 11



Simply download the sample database from Roger's website (link in my original reply). It has everything you need. You merely copy it into your db and it works. You can also take the time to dissect it and understand it, but at least you are starting from a fully functional example.
Go to the top of the page
 
akbarmahfuzalam
post Jan 9 2020, 01:29 AM
Post#10



Posts: 46
Joined: 8-December 19



Hi,

http://www.rogersaccesslibrary.com/downloa...LogUsersOff.mdb

When Downloaded the sample file, getting an error message as " Cannot open a database created with a previous version of your application"

How to go about, please help, I am using MS Access 2016.

Rgds,
Akbar Alam
This post has been edited by akbarmahfuzalam: Jan 9 2020, 01:30 AM
Go to the top of the page
 
isladogs
post Jan 9 2020, 05:39 AM
Post#11


UtterAccess VIP
Posts: 2,312
Joined: 4-June 18
From: Somerset, UK


The link in the last post is incorrect but the one in post #2 worked.
I've updated the utility to A2010 but you will need to relink the FE and BE.
Hope that helps

NOTE: I've not tested it as I have my own code to do this. From the description mine is almost the same.
Attached File(s)
Attached File  LogUsersOff2010.zip ( 60.25K )Number of downloads: 9
 

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
akbarmahfuzalam
post Feb 14 2020, 02:14 AM
Post#12



Posts: 46
Joined: 8-December 19



Hi ,

Can someone help me with code that need to go behind the Disconnect User and Send Message Button.

I tried to find but failed. Help is highly appreciated !
Attached File(s)
Attached File  Mdification.JPG ( 79.31K )Number of downloads: 1
Attached File  CheckCurrentUsers_v3.zip ( 61.46K )Number of downloads: 2
 
Go to the top of the page
 
theDBguy
post Feb 14 2020, 12:17 PM
Post#13


UA Moderator
Posts: 78,128
Joined: 19-June 07
From: SunnySandyEggo


To all contributors: If answering the above post from user akbarmahfuzalam, please do so in this new thread. Thank you!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    1st June 2020 - 07:52 PM