473,656 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"kicking" users from a database

Another Q,

Because we sometimes need to repair the shared database I would like
to find out if there is a way to "kick" all users from a database. The
problem is that I cannot repair the database when it is beeing
accessed by another user and this almost always seems to be the case.
With another tool I downloaded I can identify the users still in the
database and send them a NET message to exit the DB.

Does anyone know how I can do this programmaticall y, or if I can deny
users access to the database for a while?

thx, Seansan
Nov 13 '05 #1
4 2500
seansan wrote:
Another Q,

Because we sometimes need to repair the shared database I would like
to find out if there is a way to "kick" all users from a database. The
problem is that I cannot repair the database when it is beeing
accessed by another user and this almost always seems to be the case.
With another tool I downloaded I can identify the users still in the
database and send them a NET message to exit the DB.

Does anyone know how I can do this programmaticall y, or if I can deny
users access to the database for a while?


Common approach to this is to have a form open, but hidden; the form has
a Timer event, and checks on every timer for a certain condition (some
file on the network exists, or some record exists in some table--you can
use that if tables sit in a backend on a shared location). If the
condition applies, display a message and issue a Quit statement.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2
> Does anyone know how I can do this programmaticall y, or if I can deny
users access to the database for a while?


There's no built-in way to do this, so you have to code your own
method. Basically, what you would want to do is:

Create a table that's going to let you know whether access is allowed.
Call it USys-something, because the database will hide it, even if
you check 'show hidden objects.' It won't confuse anyone, and nobody
will know to tamper with it. You could either just have one row with
a yes/no field, or a history and scheduler.

Then on each form and report, have a function that checks your table,
and closes the database if you've put it off limits. Call your
function when the form loads, and probably on a timer.
Nov 13 '05 #3
I have been doing that for a couple of years on a system in our
factory. I have the main menu check once per minute for an entry in a
table that says that I need the database. When each user's code
detects the flag, a routine closes all the forms except the main menu
and a dialog box is displayed explaining the situation. The main menu
does not access any tables so I am free to do whatever maintenance is
required.
I prefer this method as opposed to shutting down their
application because then the user would not know exactly what has
happened. The dialog box stays up, the flag is checked again, once
per minute, and when the condition changes, the dialog box is closed
and the user can continue at will.
I use the following code to close all forms. There are probably
better ways but this works.

Dim obj As AccessObject, dbs As Object
Set dbs = Application.Cur rentProject
' Look for open forms
For Each obj In dbs.AllForms
If (obj.IsLoaded) Then
strName = obj.Name
' Close all open forms except "Main Menu" and "QuitForm"
If ((strName <> "Main Menu") And (strName <> "QuitForm") ) Then
DoCmd.Close acForm, strName, acSaveYes
End If
End If
Next obj
Nov 13 '05 #4
Hank Reed wrote:
I have been doing that for a couple of years on a system in our
factory. I have the main menu check once per minute for an entry in a
table that says that I need the database. When each user's code
detects the flag, a routine closes all the forms except the main menu
and a dialog box is displayed explaining the situation. The main menu
does not access any tables so I am free to do whatever maintenance is
required.
I prefer this method as opposed to shutting down their
application because then the user would not know exactly what has
happened. The dialog box stays up, the flag is checked again, once
per minute, and when the condition changes, the dialog box is closed
and the user can continue at will.
I use the following code to close all forms. There are probably
better ways but this works.

Dim obj As AccessObject, dbs As Object
Set dbs = Application.Cur rentProject
' Look for open forms
For Each obj In dbs.AllForms
If (obj.IsLoaded) Then
strName = obj.Name
' Close all open forms except "Main Menu" and "QuitForm"
If ((strName <> "Main Menu") And (strName <> "QuitForm") ) Then
DoCmd.Close acForm, strName, acSaveYes
End If
End If
Next obj


You're too kind to your users, I give users plenty of warning by use of
the polled table mentioned elsewhere in this thread, then if they're
still in then tough titty, they should know better than to defy me :-)

Actually it's defying the client's admin bod, but I give him the means
to do it and the "Kick Users" button has been renamed "Kill Users" by
request from one of them, something I gladly complied with, didn't even
charge him for that one.

--
This sig left intentionally blank
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7310
by: Follower | last post by:
Hi, I've run into an issue which seems to have been discussed previously on `python-dev` but only in context of Zope3: "Fun with 2.3 shutdown" -- Tim Peters <http://mail.python.org/pipermail/python-dev/2003-September/038151.html> The following message is displayed (one or more times) when exiting (in this case via a `KeyboardInterrupt` exception) a multi-threaded
0
2339
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and Methods Version: $Revision: 1.34 $ Last-Modified: $Date: 2004/09/03 09:32:50 $ Author: Kevin D. Smith, Jim Jewett, Skip Montanaro, Anthony Baxter
8
5737
by: Hostile17 | last post by:
Consider the following HTML. ---------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <title>Untitled</title>
11
9409
by: Daniele Benegiamo | last post by:
Is the following program standard-compliant? I've compiled it with some compilers and no errors or warnings are produced, but this is not a demonstration. The "incriminated" part is the declaration: extern "C" struct X; that is then defined as:
6
4468
by: Tom Kaminski [MVP] | last post by:
I can do this in ASP, but not sure how to handle in ASP.NET: How To Use the ADODB.Stream Object to Send Binary Files to the Browser through ASP http://support.microsoft.com/?kbid=276488 Do I need to use BinaryReader? Can someone give me an example?
2
3289
by: Jeff_Mac | last post by:
Hi there. I'm a bit of a newbie, and I would appreciate any help that anyone can give me on an error I'm getting with Crystal Reports. Every time I attempt to view a report using the Crystal Report Viewer, I get a "Load Report Failed" error, and I'm not sure what I can do to resolve it. I know it's not the connection to the data -- I'm able to get a datagrid to display the data just fine after filling a dataset. I tried searching the...
30
2893
by: bblais | last post by:
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for some help to find out how the same thing is done in Python. I am not sure what the standard is. In C++, I open up an editor in one window, a Unix shell in another. I write the code in the editor, then switch to the shell window for compile...
5
3209
by: Duderino82 | last post by:
I'm working on a very simple peace of php where basically there is a form and 3 buttoms. One refreshed the page, one posts the form, and another one (since this form contains values of a record) deletes the record. The sintax is this one: if ($delete) { header ("Location: $redirect?del=$code&table=$tab"); exit; }
9
8582
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...
0
8382
marktang
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...
0
8297
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,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
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,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5629
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();...
0
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.