Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1327
  • Last Modified:

Kill connection on MS Access database

Does anyone known if there is a utility or simmilar to kill a user connection to a MS Access 2000 database?

I have a database in a network and many users who only have read access.

If, for any reason, I need to make a little change in a Form or to repair and compress, etc., etc I have to ask everbody who is connected to get out and when all of them are out I can take the control.

And if someone is not in their desk I can´t close the application until he comeback.

Thank you
 
 
0
dspeier
Asked:
dspeier
  • 2
  • 2
  • 2
  • +1
1 Solution
 
TextReportCommented:
Firstly, I would not let the users share your FrontEnd App. Personally I would copy the front end to the local PC rather then get then run the front end across the network. When you have done your development changes then release a new version to them when you are ready.

With regards to your actual problem, Windows NT (and I assume Novell does also) has the facility to check who is locking the file and you can then force them off.

Cheers, Andrew
0
 
ornicarCommented:
I agree with TexReport. Leave the users alone. Do your changes on another database and release it at night. Same for the compacting.

You can use Control Panel/Computer Management/Shared Folders/Sessions to see who is connected and kick them out, but I would not recommend doing so: This is rude.
0
 
dspeierAuthor Commented:
The problem is that I don´t have Administration rigths on the NT server where is the database running.

Don´t you know any utility to do so? or to send a messagge to the user thru the access?
Tks.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ornicarCommented:
You can use the NET SEND command, something like:

net send <username> "Please close your database, I need to do some maintenance. Thanks"

You could also develop something more sophisicated: A hidden form with its Timer Event reading a table. When the value of this table is changed, make the form visible, wait for a few minutes and close the application.
0
 
TextReportCommented:
Although the LDB file will indicate which PC is locking the file it will not indicate the username, you need to pass it on to your network administrater to "kick them out".

Other options to think about are:-

1. An AutoClose procedure if the user hasn't done something for a specified amount of time.
2. A messaging routine to all current users logged in.

Both of these can be achieved using the OnTimer event of your main form.

Cheers, Andrew
0
 
VolibrawlCommented:
I agree totally with the others.  Your application should be split into a backend and several frontends.  The following technique will work either way, however.  The form with the timer event needs to be running on the user's machine (either through the shared application or their own frontend).

Here is some code I use in one application.
It requires:
One table, a timer form and a message form, a snippet of code.

1. Create a new (timer) form, set it to open and hide on startup of the application.  Leave it open always.  Attach the code to the form's Timer Event and set it to "look" every couple of minutes. My timer is set to 3 minutes, but yours could be anything.

2.Create a simple form (for the message) that has a label with a message in it tht the sytem will be shut down.

3.Create a table (U BUMP).  It only needs 2 fields (BUMPLVL and BUMP). Bumplvl is only used to "help" the dlookup, put a 1 in it.  The table should be a linked table which the administrator has access to OR if the application is a single shared app, it needs to be in the database that all the users are using.

USAGE/LOGIC: When desired, the administrator opens the table (u Bump)and changes the value of the field "Bump" to WARN.  When the code runs, it sees that value and causes a message form to open (the form basically says get out 'cuz the application will be shut down in 5 minutes.)
Five minutes later, the Administrator then sets the value of "Bump" to NOW.  When the form's timer sees that the value is NOW, it runs the quit command closing the DB.

Private Sub Form_Timer()
  
   Dim bumpout As String
   bumpout = DLookup("bump", "u bump", "bumplvl=1")
   If bumpout = "Warn" Then
   DoCmd.OpenForm "bump message"
  
  
   ElseIf bumpout = "Now" Then
   DoCmd.Quit
End If

http://www.experts-exchange.com/Databases/MS_Access/Q_20112012.html?query=bump&searchType=topic
0
 
dspeierAuthor Commented:
Thank you very much to all of you. I will use your advices and will try to do what Volibrawl said.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now