Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2003
    Location
    Lebanon
    Posts
    44

    Unanswered: Disable a LAN connection

    Hello, I have a access application shared through a LAN connection by 5 computers, I need it to do compact and repair automatically every 2 days at 10 pm. I know how to do it but the problem is that if this application is open on any of the computers that are sharing it, it won't compact and repair. So I though about looking for a code that disconnects the computer where this application is, from the LAN, do the compact and repair job then reconnect this computer to the network again.

    Does anybody know a code that disconnects/reconnect a LAN connection ? Thank you.
    Dani_30

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I don't think there is any code off the shelf that remotely disccnects users form a db.

    there are solutions, one is to have a hidden form which periodically checks to see if a flag (say in a table) is set and then terminate the application,

    you can set a flag that stops users opening the db

    you can find out who the connected users are, and for 5 usrs thats the route I'd go down... its possible to query the lockfile and find out which computers are connected. The code is posted somewhere on the net.

    id have a google
    ...but this seems interesting
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Oct 2003
    Location
    Lebanon
    Posts
    44

    Disconnect the network card

    Thank you for replying,
    I don't want to disconnect users from a db remotely, I'm thinking of a code that runs on the same computer where the database is, this code should disconnect the network card of this computer from the network
    Dani_30

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    disconnecting the network car under software control.....


    even if its possible, im not sure its a smart or clever solution.

    Access when using JET as its data engine (the default setting) is very prone to problems if there are network problems.

    in my view its also not smart, in as much you dont know what other services may or may not be running which could be affected by netwrok isues.

    Id suggest that given your user requirement that to find who is using the application, and get them to manually logoff. after all you have 5 users.. if required have them use the windows message service.. forget what its called.

    Effectively your problem is an Access problme.. getting users to get out of the db whilst you do housekeeping or back up... so it needs an Access solution not a hardware / OS solution
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Oct 2003
    Location
    Lebanon
    Posts
    44

    Network card disconnection

    I agree that this is not the best way to do it but suppose that one of the 5 users opens the database remotely on his computer, then he leaves his office and closes it with the keys while the application is still running on his computer.
    Dani_30

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    then you grasp them warmly by the throat, and ask if they want a burial or cremation.....

    if you have users doing things like that then train them out of it... FAST

    If you let your users do that then the alternative is as suggested earlier to have a hidden form that is opened without the user knowing, that hidden form periodically polls a central table to see if it should shut down if a specific value is set.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Timer events might be a good idea... You could have the database shut itself when the time is e.g. >11pm. *shrugs*
    George
    Home | Blog

  8. #8
    Join Date
    Oct 2003
    Location
    Lebanon
    Posts
    44

    Disconnect the network card

    Thank you guys for bearing with me,
    Actually I have already created a hidden form, on which there is a kind of countdown which is reset to 2 each time the user clicks on any button on the other forms. The countdown is decremented by 1 every 5 minutes which means that the database autocloses itself if the user doesn't click any button for 10 minutes. This form also makes the database close automatically after 10 pm.
    Despite all this, I still think that I may have a problem, suppose in the example that I told you about in my second reply, that the user leaves the office with the application still running and the computer, for a reason or another freezes. If this happens, this is a scenario where this idea may fail. In this case the only thing that I can do is to disconnect my database from all the other computers either by restarting the computer where the applcation is or by disabling the connection of this computer then re-enabling it, or .. if feasible .. by doing this thing through a VB code that does it automatically.
    If I don't find a way to do it with microsoft access, i will create a form that restarts the computer at ... say 10 pm .. and I will include in the startup folder a link to another form that does the compile and repair at startup before any user connects again to the database
    Dani_30

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so you are concerned about people walking away from their workstation with the app still open.

    you already have your timer on a hidden form....
    there are mechanisms to shutdown access via code
    there are freely available addons to do that if you dont want to do it yourself

    In most network environments I have workded in recently leaving an app opened or workstation logged on when you are not present is an immediate disciplinary. Its a basic rule that users don't leave apps open and workstations connected whilst they are away from their desk. It doesn't matter if the are directors or in the warehouse.

    I still think you would be well advised to look at the code to find out who is using your db is worth implementing. That way round you have agood idea who is connected tot he app.
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    Aug 2006
    Posts
    559
    The above from healdem is what I'm going to do when I get my db working the exact way that I want it. I'm going to have it log the user off after a certain amount of time and then back itself up at like midnight since that is usually when most people are not at work and it can be done.

Posting Permissions

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