Close all open database sessions remotely (1 Viewer)

Teggun

Registered User.
Local time
Tomorrow, 00:40
Joined
Aug 30, 2019
Messages
33
Hi guys, when I have to update the my Database_fe I have to manually go computer by computer and shut down all databases that are open. I wonder I there is any way to close all of them, but not mine, for example just by clicking a button in my admin panel.

I've found a particular example in this forum but it worlks using a timer, which I'd prefer not to use.

https://www.access-programmers.co.uk/forums/showthread.php?t=84557&highlight=close+everywheredatabase

Any idea how could I perform this? I have no clue where to start.

Thanks for your time.
 

isladogs

MVP / VIP
Local time
Today, 23:40
Joined
Jan 14, 2017
Messages
18,216
Its easy enough to close all running copies of an app.
I use a Boolean field Kickout in the BE & have the FE check for it every 30 seconds using a hidden form that is always on. That also acts a persistent connection o the BE which can improve performance

When the kickout field is set True a countdown procedure starts giving users a short time e.g. 5 minutes to save any work then closes the app.
NOTE: That countdown time is vital to prevent data corruption

I explained the process in detail together with an example app in this post:
https://www.access-programmers.co.uk/forums/showpost.php?p=1546375&postcount=13

Its also possible to modify the code to allow the program admin to keep using the app for maintenance purposeswhen everyone else has been kicked out.

However I'm concerned by the way you've written the question whether each user is SHARING the same networked copy of the FE. If so disaster WILL occur at some point as data WILL get corrupted.
The correct approach is for each user to have their OWN copy of the FE on the own hard drive.

By doing that you can work on your own copy of the FE, update it then distribute it to other users when ready
 

Teggun

Registered User.
Local time
Tomorrow, 00:40
Joined
Aug 30, 2019
Messages
33
That is exacly what I was looking for, thanks a lot for your example!

However I'm concerned by the way you've written the question whether each user is SHARING the same networked copy of the FE. If so disaster WILL occur at some point as data WILL get corrupted.
The correct approach is for each user to have their OWN copy of the FE on the own hard drive.

That is right, but the thing is all the users are accessing the db from the same computer (server), while I manage it using a local copy in a different one. So I assume that would not be a problem since I just need to remotely shut down this specific one in order to update the FE. I just said "computer by computer" to emphasize the fact of having to go and manually shut it down.

Thanks again for your time :)
 

isladogs

MVP / VIP
Local time
Today, 23:40
Joined
Jan 14, 2017
Messages
18,216
That is exacly what I was looking for, thanks a lot for your example!

That is right, but the thing is all the users are accessing the db from the same computer (server), while I manage it using a local copy in a different one. So I assume that would not be a problem since I just need to remotely shut down this specific one in order to update the FE. I just said "computer by computer" to emphasize the fact of having to go and manually shut it down.

Thanks again for your time :)

Glad the example was helpful.
However, as I understand it, all users except you are running the same copy of the FE on the server. That is a very bad idea for the reason I stated. Data corruption will occur at some point. At worst, your whole BE file will be corrupted and unrecoverable.
Also if you do have multiple users running that file at the time you set the kick out , I doubt my routine will work anyway.
 

Users who are viewing this thread

Top Bottom