Can I programmatically disconnect users from a backend db?

crook

Registered User.
Local time
Today, 12:32
Joined
Aug 21, 2003
Messages
18
I don't use this often... I think I'm going to ask something that may be posted here somewhere, but I couldn't find anything in the search, so have mercy...

I have an Access 2000 database that is shared over a network (Novell). The backend lives in a shared network drive. Then there are several front-ends that connect to it - some from the same shared network drive, and others from users' C-drives.

I need to update a table design and/or compact & repair the backend, and to do that must open it exclusively. But there is some file linking to it that is currently in use. Access doesn't identify the file.

This is a common problem. Normally, it entails me jogging around the office asking everyone to close their frontends. But is there a way I can programatically kick them out of / break their links to the backend?

I need to do this because some users go home / to lunch and lock their offices with their computer still logged in, and I can't check those computers to see if they have the database open.

Any advice will be appreciated.
 
it's the LDB file that locks the database. Go to command console and move to the directory where the LDB file is and type the following so it looks something like this:

C:>TYPE C:\pathtodatabases\db.ldb

where pathtodatabases is your file path and db.ldb is the name of the lock file.

It will show you what workstations have the files locked. By that , I mean it will show you the workstation names. If you know what user is associated with what workstation, then you should be able to send a message to those users to close the db.
 
There are numerous threads floating around on how to do that. I prefer the non-use [no activity for x minutes] method. How hard did you search? ;)

Here are links to two different methods from Rogers site...

LogUsersOff.mdb

LogUsersOffNonUse.mdb

HTH
 
NO WAY!!:eek:

that is slick.. thanks for that. I could use this quite a bit. :)
 
Thanks

There are numerous threads floating around on how to do that. I prefer the non-use [no activity for x minutes] method.

This is great - thank you very much!


How hard did you search?

I was hoping asking for mercy would save me from comments like that! ;) No, really, I searched for several keywords / keyword combinations, read though about 30 threads that were returned on various searches, but didn't find anything. I knew as soon as I gave up and posted my question that someone would be able to point to a previous post that had the answer... I'm just going to have to login and read though posts more often, I think. Anyway, really appreciate your help.

- dave
 
ghudson,

I downloaded the sample "LogUsersOff.mdb" you referenced in your post earlier and tried to use it with my database but I can't get into the switchboard form because someone is in the database. Do I have to set this program up when no one is in the system? Because that's the problem. When I need to do updates I need to be able to disconnect the user right then. Like now.
 
Can I Kick them out now

My problem is .. currently, at this very moment someone is in the database and I can't get in touch with them to have them close out of the database. Is there a way for me to kick them out right now.

The code from the LogUsersOff sample works fine. But for me to implement that with the database that someone has open now, I would have to have exclusive use. So ... Is there a way to kick them out now and then apply my program or do I have to wait for exclusive use.
 
AFAIK you will need to wait for exclusive access.
 
I am trying to use and understand this program (LogUsersOffNonUse2k.mdb) and find that in order for the Log-off to work on other users, the users must have the form (frmLogOffafterNonuse) open. If the other users do not have this form open, they are not logged off.

How can I make adjustments to the program so that all other users are logged off even though this form is not open on their desktops?

Please help

Feinj
 
Simple Software Solutions

A simple workaround I have employed is to use the DetectIdleTime routine explained on KB article 210297.

A minor alteration is needed, which is:-

instead of using a Autoexec Macro copy the folllowing line into your main menu screen in the OnLoad Event

DoCmd.OpenForm "DetectIdleTime", acNormal, "", "", acEdit, acHidden

Also instead of displaying a message box to show inactivity change the code to be



If ActiveFormName = "FrmMainMenu" (your main menu form name) then
Application.Quit acSaveYes
Else
DoCmd.Close ActiveFormName
endif

What this does is close the current form that has the focus, when it gets back to the main menu it then quits the application. The benefit of this is that users who load the application then walk away from it are automatically logged out of the app.

Hope this solves your problem.
:)
 
Simple Software Solutions

Hi Again,

Just found an article on KB that may help

Article no :304408
 
I am trying to use and understand this program (LogUsersOffNonUse2k.mdb) and find that in order for the Log-off to work on other users, the users must have the form (frmLogOffafterNonuse) open. If the other users do not have this form open, they are not logged off.

How can I make adjustments to the program so that all other users are logged off even though this form is not open on their desktops?

Please help

Feinj
Roger posted this db as an example of a method one could incorporate into their application to close an application with no activity. You are correct in that the user would need to have the main form open for the action to take place. Take a look at some of the links that Jeff Conrad has for some examples that require very little modification to work in any application. I personally load an invisible form 1st in my applications that watch a table periodically in the timer event to see if the admin wants to close the application.
 
Hey DCrake,

The solution you provided above using the code from KB Article 210297 slightly modified works great.

Much Thanks for the assistance,

Feinj
 
The solution proposed by DCrake worked extremely well.

thanks for the help

Feinj
 

Users who are viewing this thread

Back
Top Bottom