Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Script for disconnecting users from shared files 1

Status
Not open for further replies.

HarleyGod

MIS
May 6, 2005
18
0
0
US
Can anyone tell me where i can find a script to disconnect users from a shared file on a Windows 2003 server? Basically I am going into the server manually everyday and disconnecting any users that are connected to this shared file. Sorry about the lack of description. It is an Access database that about 15 users log into yet they don't log out of properly, therefore, locking their sessions when they try to open the file the next day. The users just close Access without logging out of it. We are moving the database to a SQL server but not for about 5 weeks. This is a daily occurrence even though the users have been told repeatedly to log out properly. I am looking for a script to close this file at the end of the day instead of having to go in manually and view who is connected to the file and disconnect them.Any help would be appreciated!
 
Hi,

Could you please describe the current db setup? I think you should solve the cause of the trouble, not the symptoms.
It sounds to me you have not split your DB in front- & back-end - is this true?

 
Well..this is a temporary fix. I have not designed the databse nor do I have access to the person who did. I am a network admin. I have users complaining that they cannot access this MS Access database because the next day because users from the previous day are not logging out properly. The group is moving this MS Access databse to SQl within the next 5 weeks. They need a temporary fix until that time.
Thanks for any help!
 
Hello HarleyGod,
I had a similiar problem of users not exiting the db correctly. Try this code, it prevents access from closing, until a certian form is closed. Can't take credit for the code, But it works great!

Create a new form, I call it hfrmCloseAccess, paste the form code from below. Paste the module code into a new module.

Create an autoexec macro, Choose Open Form, then select hfrmCloseAccess, set it's Window Mode to HIDDEN...

No to Close ACCESS...
On your Main Menu, add the code to close this form when the user clicks EXIT.

Module Code
Code:
Option Compare Database
Option Explicit

Public pboolCloseAccess As Boolean
'Note: Access 2.0 does NOT recognize Boolean
'type variables. Use integer type instead,
'passing a -1 as True, and 0 as False.

Form Code
Code:
Option Compare Database
Option Explicit

Private Sub Form_Load()
    pboolCloseAccess = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If Not pboolCloseAccess Then Cancel = True
End Sub

Hope this helps...

AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top