I have multiple Access 2003 databases. I do most of the editing in them all the time. I am having a problem of users all over the state being in the database, and won't get off of it. I currently use LDB Viewer. (Which just tells me the computer name that's currently connected). But, is there a way I can write something that will knock everyone out, of whomever I choose, so I can edit the database?
Thanks
Jan 6 '10
14 37633 Megalog 378
Recognized Expert Contributor
Twinny,
Sadly, I dont have an easy copy/paste code solution to provide for this. I posted my basic approach at the beginning of this thread, and you should use this as a roadmap to your custom approach. It will involve the use of a hidden form with a timer, a small table to store the login/logout information, and basic code to save & close access.
If you get stuck on any specific steps, leave a detailed post and I'll try to provide an answer.
@anoble1
I found a simple solution a year back or so that involves opening a form Let's call it zzMXLOCK with the autoexec macro. It opens hidden and the OnLoad Event looks like this: - Private Sub Form_Load()
-
Dim strFileName As String
-
strFileName = Dir("X:\NetworkFolder\Subfolder\LOCK.ozx")
-
If strFileName <> "LOCK.ozx" Then
-
Application.Quit acQuitSaveAll
-
Else: DoCmd.OpenForm "zzMxShutdown", acNormal, "", "", acFormReadOnly, acHidden
-
DoCmd.CLOSE acForm, "zzMxLock"
-
DoCmd.OpenForm "MAINNAVIGATION PAGE”
-
This will only work for a split database where you can have the form “look” for a specific file
By renaming the file when the database goes to load and the macros are enabled (use .accde Or .mde)
The one form loads sees the file doesn’t exist and keeps the user from entering the DB. This locks the database, now the form “zzMXShutdown”m entioned above does that same thing but on Open and On Timer. To be nice I add a form called “zzAppShutdownW arn” that lets the user know they are about to be booted. The nice thing about calling a form and not a message box is you can more easily tailor the message later. - Private Sub Form_Open(Cancel As Integer)
-
' Set Count Down variable to false
-
' on the initial opening of the form.
-
boolCountDown = False
-
End Sub
-
-
Private Sub Form_Timer()
-
On Error GoTo Err_Form_Timer
-
Dim strFileName As String
-
strFileName = Dir("X:\Networkfolder\Subfolder\LOCK.ozx")
-
If boolCountDown = False Then
-
' Do nothing unless the check file is missing.
-
If strFileName <> "LOCK.ozx" Then
-
' The check file is not found so
-
' set the count down variable to true and
-
' number of minutes until this session
-
' of Access will be shut down.
-
boolCountDown = True
-
intCountDownMinutes = 2
-
End If
-
Else
-
' Count down variable is true so warn
-
' the user that the application will be shut down
-
' in X number of minutes. The number of minutes
-
' will be 1 less than the initial value of the
-
' intCountDownMinutes variable because the form timer
-
' event is set to fire every 60 seconds
-
intCountDownMinutes = intCountDownMinutes - 1
-
DoCmd.OpenForm "zzAppShutDownWarn"
-
Forms!zzAppShutDownWarn!txtWarning = "This application will be shut down in approximately " & intCountDownMinutes & " minute(s). Please save all work. There will be no other warning"
-
If intCountDownMinutes < 1 Then
-
' Shut down Access if the countdown is zero,
-
' saving all work by default.
-
Application.Quit acQuitSaveAll
-
End If
-
End If
-
-
Exit_Form_Timer:
-
Exit Sub
-
-
Err_Form_Timer:
-
Resume Next
-
End Sub
I also use a hidden form to track login info, which also stores a yes/no checkbox, which I can uncheck at anytime. Every 60 sec, the form checks for "loggedIn", and if 0 then opens a warning page. The warning page gives the user 45 sec notice to get out, and then does a DoCmd.Quit acQuitSaveAll. I've considered running code to change (temporarily, of course) that user's login info, so they can't just jump back in, but haven't needed it yet.
That's interesting discussion. Megalog, I am concerned to know what code you use to perform the kick off safely and save the records that are being used when you said " then it saves whatever record they are working, logs them out, and closes access"
Thanks
Megalog 378
Recognized Expert Contributor
After all the checks and measures are done, and the user logging is complete, I believe all it does is: - DoCmd.RunCommand acCmdSave
-
DoCmd.Quit
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sven Jacobs |
last post by:
Dear newsgroup,
I've upgraded to PEAR::DB 1.6.5 recently. Unfortunately now the database
connection doesn't work as expected anymore :( The problems seems to be the
method disconnect(), which now closes the database connections of _all_
database objects. I ask myself if this is intentional or a bug. Below a
code example:
01 <?php
02 error_reporting(E_ALL);
|
by: Tony Do |
last post by:
I have the backup command
BACKUP DATABASE NEST TO C:\\databases WITH 2 BUFFERS BUFFER 1024 $
How do I force all the user to disconnect? before running the above command
|
by: Marc Jennings |
last post by:
Hi,
I need to rebuild a database each time I redeploy a test applicatio,
and I was wondering if anyone could give me some clues as to how to go
about disconnecting any users that may be logged into that database in
SQL. I know I can do this quite easily using MSBuild, but the reason
I need to know is so I can get awayt from using beta tools in
development. (We have a specific issue with MSBuild)
Also, if anyone knows of a good...
|
by: Macca |
last post by:
Hi,
I have an windows forms application that accesses a SQL database
I have a few questions as to connecting to the database.
This application will run 24 hours a day. It is a monitoring application and
will store events that happen in the database (These events happen randomly
without pattern, between 10-50 a day) .
There are a number of situations where the database is accessed.
|
by: mamod20 |
last post by:
Please advise, I have the following example and want to know the best
way to use $dbh->disconnect; and $sth->finish;
--------------
$sql_host="localhost";
$sql_dataname = "database";
$sql_userid = "root";
$sql_password = "password";
&connect_sql;
| |
by: Laurence |
last post by:
Hi there,
Does anyone know what's difference among "connect reset", "disconnect",
and "terminate"?
Thanks in advance,
|
by: raylopez99 |
last post by:
10 years ago, the below was written (see very end, after my signature
RL).
What, if anything, has changed?
I have Access 2003 and soon Access 2007 on a Windows XP Professional
or Windows Vista Ultimate machine, with SQL Server Express running on
it, and I want somebody, with a password (which I will provide) to be
able to log onto a A03 or A07 dB from the internet. Now that I type
this I realize that unless I put the database onto a...
|
by: TMAG |
last post by:
If i do "db2 disconnect all" after an application finishes, does it
mean that any application that connects after this will find the buffer
pool "cold"? Or the pages accessed by last application will be still in
buffer pool? Apparently when I do "db2 disconnect all" at the end, the
windows task manager shows that all bufferpool memory has been deallocated.
thanks
|
by: Kelii |
last post by:
Currently I have a button that allows the user to "Close Company" - at
the moment it doesn't do anything :D I would like the button to
"disconnect" the back end then show my Open Company form.
My question is:
1. Short of closing the application or deleting the linked tables, is
there a way to disconnect the user's front end from the common back
end using VBA?
2. Does disconnecting the user serve any purpose? I've read a lot of
posts...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |