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
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?
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.
I found a similar thread. And I have a question on it. Please see the question on the bottom. - Sub ShowUserRosterMultipleUsers()
-
Dim cn As New ADODB.Connection
-
Dim cn2 As New ADODB.Connection
-
Dim rs As New ADODB.Recordset
-
Dim i, j As Long
-
-
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
-
cn.Open "Data Source=S:\Workgroups\APC Power Delivery-Contract Services\Safety Meeting.mdb"
-
-
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
-
& "Data Source=S:\Workgroups\APC Power Delivery-Contract Services\Safety Meeting.mdb"
-
-
' The user roster is exposed as a provider-specific schema rowset
-
' in the Jet 4 OLE DB provider. You have to use a GUID to
-
' reference the schema, as provider-specific schemas are not
-
' listed in ADO's type library for schema rowsets
-
-
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
-
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
-
-
'Output the list of all users in the current database.
-
-
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
-
"", rs.Fields(2).Name, rs.Fields(3).Name
-
-
While Not rs.EOF
-
Debug.Print rs.Fields(0), rs.Fields(1), _
-
rs.Fields(2), rs.Fields(3)
-
rs.MoveNext
-
Wend
-
-
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?
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.
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!
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?
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.
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.
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: 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.
| |
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...
| |