Programatically Kicking users out of a Database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CoopEng
    New Member
    • Feb 2008
    • 18

    Programatically Kicking users out of a Database

    Alright Team,

    I've got a multi-user database that I need to be able to update whenever I need to. It seems that the simplest way to do so is to simply kick out all of the users, then make my changes while I have exclusive access. There are users on the db 24/7 so it would be a hastle to have to go to each computer and close the db on each computer.

    I know there's a way to programatically kick out all users of the database, however I do not know how exactly. I'm using Microsoft Access 2003. If I am able to kick off all users what would happen to any data they were currently working on?
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #2
    The way you are thinking is not good.
    You need to copy all databases to a specific location and then made changes their. Now when you have made all changes display a msgbox to users that an update is available so they stop their working after that copy all modified databases to their original location.
    I think this seems some sense.
    Otherwise your thinking is not good when users are kicked off they will think some thing bad is going to happen with th programe.

    Regards
    >> ALI <<

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Can you please explain what do you mean by Kicking users out of a Database
      .

      Comment

      • CoopEng
        New Member
        • Feb 2008
        • 18

        #4
        Ali,

        I know what you meen by the people thinking something bad is happening when their program all of a sudden just closes. But the problem with simply asking everyone to turn off their databases is that people aren't always on their computers. I'm at a manufacturing plant and the shift supervisors leave their programs running all the time and are rarely in their offices. Making it unlikely for them to close their programs when asked.

        What I mean by 'Kicking users out of a database" is that I want to be able to edit forms and queries to a database at certain times, and I feel that the only way to gain true exclusive access is to have all other instances of the database closed. As I said above it isn't likely that my simply asking people to close their database will work in my case.

        Here's the dream

        I send out an email to everyone telling them that upgrades have to be made to the database at some given time. I ask them to close all of their databases for that time. When that time comes, if some people have 'forgotten' to turn of their database's, then I send them a message through the database saying something like "The database will close in 5 minutes for scheduled maintenance. Please close the database". Then if they still refuse to close it the database simply kicks off all the users. Allowing for me to have exclusive access, and thus make the necessary changes.

        That's what I had in mind. I know that there will have to be quite a bit of code involved. For instance possibly user accounts, timers etc. But I really don't know where to start in writing it... is this dream is even attainable... or maybe it's just a dream.

        Any help is much appreciated.

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          That will be very easy if you are using Oracle.

          You can simply kill the Session of the idle users.
          But i am not sure of that in Access .

          Comment

          • CoopEng
            New Member
            • Feb 2008
            • 18

            #6
            Originally posted by debasisdas
            That will be very easy if you are using Oracle.

            You can simply kill the Session of the idle users.
            But i am not sure of that in Access .
            I have been seeing some code that kicks Idle users. That would work I think. However what about those users that simply forget. They aren't nenessarily indle or inactive. I'll still need to be able to close their databases too.

            Just as a side note. What do I have to do to send all users a message over access. Is there a DoCmd function for that?

            Comment

            • Ali Rizwan
              Banned
              Contributor
              • Aug 2007
              • 931

              #7
              Coop,

              What you are thinking is not a dream. And is not difficult to do this. I can made a simple application which seeze the database for sometime.

              Ok now read the scenario bellow i think this will help you to make such thing:::

              1>>
              Some one is running the programe and using database. You have to put a timer which checks updates. When you have made changes to the temporary dbases send a signal to all your programs. Timer will detect that signal and seeze the database for some time i mean closes all the dbases. After update activate dbases automatically.

              2>>
              When you have made changes to dbase in tempoary dbase. A message appears as in windows appears when it is downloading updates over the net. While users are working switch them to the default dbase and then copy the temporary dbases over the original files. This option takes a bit large code but using this user will not be interacted by programe and updates will be made in silent mode without kicking them off.

              And this is surely done in ACCESS and you can update not only the idle users but also the active ones...

              You can also contact me for more helps in databases..

              Regards
              >> ALI <<

              Comment

              • CoopEng
                New Member
                • Feb 2008
                • 18

                #8
                Originally posted by Ali Rizwan
                Coop,

                What you are thinking is not a dream. And is not difficult to do this. I can made a simple application which seeze the database for sometime.

                Ok now read the scenario bellow i think this will help you to make such thing:::

                1>>
                Some one is running the programe and using database. You have to put a timer which checks updates. When you have made changes to the temporary dbases send a signal to all your programs. Timer will detect that signal and seeze the database for some time i mean closes all the dbases. After update activate dbases automatically.

                2>>
                When you have made changes to dbase in tempoary dbase. A message appears as in windows appears when it is downloading updates over the net. While users are working switch them to the default dbase and then copy the temporary dbases over the original files. This option takes a bit large code but using this user will not be interacted by programe and updates will be made in silent mode without kicking them off.

                And this is surely done in ACCESS and you can update not only the idle users but also the active ones...

                You can also contact me for more helps in databases..

                Regards
                >> ALI <<

                Ali,

                Thanks for the help. I am only working at this job for a few more months (Co-op job), and therefor whatever I do must be easy for anyone to do.

                I am a little confused with how you worded your response. Are those two different options? one that kicks off the users when I send a signal and another that seamlessly updates the database? That's how I interpreted it.

                In that case, tell me more about the first option. It seems like this requires less expertise of access. How do I send a signal to all open copies of the database and from that close them? also how can I ensure that this is done without any corruption.

                Thanks.

                P.S. Where do you go to school?

                Comment

                • daniel aristidou
                  Contributor
                  • Aug 2007
                  • 494

                  #9
                  Originally posted by CoopEng
                  Ali,

                  Thanks for the help. I am only working at this job for a few more months (Co-op job), and therefor whatever I do must be easy for anyone to do.

                  I am a little confused with how you worded your response. Are those two different options? one that kicks off the users when I send a signal and another that seamlessly updates the database? That's how I interpreted it.

                  In that case, tell me more about the first option. It seems like this requires less expertise of access. How do I send a signal to all open copies of the database and from that close them? also how can I ensure that this is done without any corruption.

                  Thanks.

                  P.S. Where do you go to school?
                  Hi ...

                  I'm Have you tried to search for this in the access forum...
                  I think i've seen questions before on this.
                  You also might want to view this Howto:
                  Passive shutdown
                  Manipulting the code in this howto i think should be easy....

                  Hope this helps.....if you need more help try searching in the access forum where i think the answer will be found effortlessly

                  Regards Daniel

                  Also ps.its not good to ask personal questions in posts :" Where do you go to school?"
                  Instead pm the user..

                  Comment

                  • CoopEng
                    New Member
                    • Feb 2008
                    • 18

                    #10
                    Well I apologive for my personable touch in conversation. I will keep things strictly business.

                    I've been through the access forums, and even posted a similiar question there. Alas it has been little to no help. I continue to get varying answers. Some mights say that you can't do anything but turn it off manually. Others say you can do it easily at the click of a button. Then some say stuff with regards to alot of preventative measures. For instance, the passive shutdown prevents new users from opening the db when i'm using it. I've seen other code that will kick out idle users.

                    Once again all of these things will help me but it is not a complete fix to my problem. Does anyone have any code kicking around that will send a message to a user giving them time to log off, then after a short time will terminate all open accounts? That would be a gold mine. If not are there any suggestions?

                    I appreciate all the help you guys have given so far. Thanks

                    Comment

                    • Ali Rizwan
                      Banned
                      Contributor
                      • Aug 2007
                      • 931

                      #11
                      OK COOP
                      Will i send you an application which do this thing that will surely is not on network but i tried to make Interface like a network.


                      Ok
                      And these are two options.

                      Regards
                      >> ALI <<

                      Comment

                      • CoopEng
                        New Member
                        • Feb 2008
                        • 18

                        #12
                        Originally posted by Ali Rizwan
                        OK COOP
                        Will i send you an application which do this thing that will surely is not on network but i tried to make Interface like a network.


                        Ok
                        And these are two options.

                        Regards
                        >> ALI <<

                        Thanks ALI,

                        I would love to see what application you have up your sleeve.

                        How will you 'send' it? will you PM it, email or simply post it? If you haven't guessed from my lack of posts, I am somewhat new to this process.

                        Thanks for the help

                        Comment

                        Working...