Force users out of DB (1 Viewer)

jubb

Registered User.
Local time
Tomorrow, 02:32
Joined
Jul 27, 2005
Messages
50
Hi all,

Problem: there is a database in use at my work that is not a FE/BE db that occasionaly needs updating, used to be ok to do by bringing up a list of users and contacting them to close the DB. Problem is the DB is now being accessed through a wireless network also, when users of the DB on the wireless access close at times it doesn't clear the connection to the DB so access thinks the DB is still in use. The only way to clear this at the moment is to down the server and delete the locking file on the server then restart or wait till the next day and delete the locking file before anyone accesses the db that day.

Is there a way to change the information in the locking file so it looks like the connection has been cleared thus allowing you to open the db then close it again to get rid of the locking file?

Any ideas appreciated.

Thanks .
 
Last edited:

Simon_MT

Registered User.
Local time
Today, 17:32
Joined
Feb 26, 2007
Messages
2,177
Yes, on the server assuming Windows:

Settings > Administrative Tools > Computer Management > Shared Folders > Sessions

Right Click Session Close Session? Yes

As there is no longer a active Connection as the Wireless Session has finished I feel that this is no worse that re-booting the server as the state of the Session will be exactly the same if you re-booted i.e. the Session will still be open.

It will possibly complain that this may cause damage but as long as there is a FE / BE solution I would be tempted to suck it and see. Although I would be cautious and also check to see what over files the user may also be accessing by checking Open Files.

Simon
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:32
Joined
Feb 28, 2001
Messages
27,317
If this is a shared server and shared database, there are threads about forcing users to exit.

In general, if your DB has a startup form that doesn't actually close but rather minimizes itself and goes invisible, there is still code underneath that form that could do the job.

I used a timer that checked two things. (1) a table of scheduled down-events. It had start/stop date/time fields and a blurb about the event. If the form detected that the current time was between the start and stop times, it popped up the blurb as a modal dialog box and then forced the application to QUIT. (2) The other way is a table that you have hiddent. Have the form timer check the table for a particular record that says, shut down if you aren't the right kind of user. (Member of Admins group...) Then when you want to shut down the DB, go in and add a record to that table. Let the timers go off to force your users out, then do your ork, then go back in to clear out that record so your users can get in again.
 

jubb

Registered User.
Local time
Tomorrow, 02:32
Joined
Jul 27, 2005
Messages
50
Already have code in place on the main form thats stays open that closes the DB after a period of inactivity, and that also checks a table in the DB to confirm whether or not to close the DB so we can flag the db as needing to be closed. This all works fine. The only problem we are having, and after thinking about it is probably not an access problem is when a couple of the users who access the db over a wireless connection close the DB the lock file is not always cleared off the server, I can identify who the users are through code I have that reads the lock file and gets the users id, when I check their computers they no longer have the db open but lock file still exists.

Thanks.
 

Users who are viewing this thread

Top Bottom