473,699 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you knock out users or Disconnect users from a database remotely?

anoble1
245 New Member
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 #1
14 37611
Megalog
378 Recognized Expert Contributor
I keep a table in the backend database that stores user login/logout information. I also have a boolean field that only I can access. In the client frontend, there is a hidden form that checks that table every 5 minutes. If the boolean field is set to True, then it saves whatever record they are working, logs them out, and closes access.

So, at any time I can log in and check who's actively using the database, and issue warnings or plain kick them all out. It works great for when I'm doing a late night update and I discover that 3 people left their databases running when they left.

Also, you are using a Front End/Back End setup for your clients right? They're not all logged into the same file?
Jan 6 '10 #2
NeoPa
32,569 Recognized Expert Moderator MVP
Not easy.

The locking system is designed to protect the integrity of the data within the database. You'd need to take that into consideration in any code you developed. I suspect something like this would involve a great deal of care taken to ensure the data was not compromised in any way in the process.
Jan 6 '10 #3
missinglinq
3,532 Recognized Expert Specialist
This site has a download with a working example and a number of other links concerning detecting who's currently using the database:

http://www.accessmvp.com/JConrad/acc...e/kickoff.html

Linq ;0)>
Jan 6 '10 #4
anoble1
245 New Member
I found a similar thread. And I have a question on it. Please see the question on the bottom.
Expand|Select|Wrap|Line Numbers
  1. Sub ShowUserRosterMultipleUsers()
  2.     Dim cn As New ADODB.Connection
  3.     Dim cn2 As New ADODB.Connection
  4.     Dim rs As New ADODB.Recordset
  5.     Dim i, j As Long
  6.  
  7.     cn.Provider = "Microsoft.Jet.OLEDB.4.0"
  8.     cn.Open "Data Source=S:\Workgroups\APC Power Delivery-Contract Services\Safety Meeting.mdb"
  9.  
  10.     cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
  11.     & "Data Source=S:\Workgroups\APC Power Delivery-Contract Services\Safety Meeting.mdb"
  12.  
  13.     ' The user roster is exposed as a provider-specific schema rowset
  14.     ' in the Jet 4 OLE DB provider.  You have to use a GUID to
  15.     ' reference the schema, as provider-specific schemas are not
  16.     ' listed in ADO's type library for schema rowsets
  17.  
  18.     Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
  19.     , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
  20.  
  21.     'Output the list of all users in the current database.
  22.  
  23.     Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
  24.     "", rs.Fields(2).Name, rs.Fields(3).Name
  25.  
  26.     While Not rs.EOF
  27.         Debug.Print rs.Fields(0), rs.Fields(1), _
  28.         rs.Fields(2), rs.Fields(3)
  29.         rs.MoveNext
  30.     Wend
  31.  
  32. End Sub
Then you push CTRL + G, then type ShowUserRosterM ultipleUsers
and it list all the computer names connected. But, how do you get the LOGIN_NAME or the NTID of the person to work on there?
Jan 7 '10 #5
NeoPa
32,569 Recognized Expert Moderator MVP
I could spend another ten minutes trying to make sense of the question, but I guess it's really down to you to spend the time to do that. I'll have another look if you do.
Jan 7 '10 #6
twinnyfo
3,653 Recognized Expert Moderator Specialist
Megalog,

I would be very interested in your code for viewing users and kicking people out of the database. I have frequent similar problems. It always seems that when I schedule an update over lunch (or evening), that this is the one time that everyone forgets to log out of the DB. i would love to have the ability to force a save (because I don't want to lose anything) and remove the user from teh system so I can perform updates.

Please post your code or contact me directly. I'd love to customize for my DB.

Many thanks!
Jan 26 '12 #7
anoble1
245 New Member
I assume you are using an Access database? If so, how many copies do you have of the database? I have 2. One on my local computer to where only I can access it. And I have one more on the network drive that everyone can see. Is yours like that?
Jan 26 '12 #8
twinnyfo
3,653 Recognized Expert Moderator Specialist
@anoble1,

Yes, on both counts: Access 2007, local master copy of database and second copy on a shared server. The time required for me to have users out of the DB is just long enough for me to copy over my new changes (several seconds, really), but is delayed when users have the DB locked for editing and run out to grab a byte to eat.
Jan 26 '12 #9
NeoPa
32,569 Recognized Expert Moderator MVP
Moderator comment:
Technically this is a hijack, but bearing in mind ANoble1 seems to be engaging the interloper, and the question never got a satisfactory answer, I'm inclined to let it ride (Splitting it away into another thread that made any sense at all would be tricky anyway - to say the least).

If anyone manages to work out what's required and actually provide a solution from these extra posts then that's an added bonus.
Jan 26 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2890
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);
2
9185
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
1
3728
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...
4
2470
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.
0
3810
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;
3
45445
by: Laurence | last post by:
Hi there, Does anyone know what's difference among "connect reset", "disconnect", and "terminate"? Thanks in advance,
0
2696
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...
1
3852
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
9
8590
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
8631
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
9055
jinu1996
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...
1
8945
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
7787
agi2029
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...
1
6550
isladogs
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...
0
5889
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
4392
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...
2
2366
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.