Results 1 to 2 of 2

Thread: disconnect user from server file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Question

    Hi all! In a program I wrote, the system administrator can
    send messages and commands to active users. One of the
    commands is a DISCONNECT command, which will terminate the
    program at all stations and allow the adminstrator to open
    the database in exclusive mode. The workstation receives
    the DISCONNECT command, and the following code executes:
    Code:
    If ClosedByAdmin = True Then RetVal = Shell(App.Path & "\Terminate.exe")
    
    For Each Form in Forms
        Unload Form
        Set Form = Nothing
    Next Form
    Terminate.exe is a small program that displays a message
    notifying the user that they have been disconnected. the
    program uses ADO connections, and most of the connections
    and recordsets are opened and closed in the Form_Load and
    Form_Unload routines, respectively.

    This has worked fine up until this morning when I was at a
    client's site and attempted to use the DISCONNECT command.
    I sent the command but still could not open the database in
    exclusive mode because it was still being accessed by one
    machine. I went to that particular machine, and apparently
    the program hung somewhere in the For Each Form loop.
    Thus, all of the connections were not closed.

    So, with this new exciting development in my programming
    life in mind , is it possible to use VB to
    detect which machines on a network are accessing a database
    file and terminate the connection?

  2. #2
    johnweidauer
    Guest

    i will get code

    But if anyone has an example, do it here, do it now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width