Global variable values when running multiple instances of a DB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    Global variable values when running multiple instances of a DB

    Good morning all -

    This is a pretty simple situation to describe. I have my database set up so that users type in a name and password when it first opens up. Provided the combination is correct, the log-in form closes and the main form opens. The username gets stored in a global variable called strUserID.

    My question is, say there are at least two different users running this database simultaneously. Am I correct in saying that there is no conflict in the value of strUserID? In other words, strUserID = username #1 for the first user, and strUserID = username #2 for the second user.

    Some of the code I'm writing relies upon there being complete separation between the two instances of the variable. Thanks so much!

    Pat
  • ajalwaysus
    Recognized Expert Contributor
    • Jul 2009
    • 266

    #2
    If each user has a separate front-end then yes the global variable only stores each users IDs distinctly, but if they are both using the same front-end db then I have no idea. I have never attempted this with a single front-end, best practices recommend a separate front-end for each user with a single back-end.

    -AJ

    Comment

    • Megalog
      Recognized Expert Contributor
      • Sep 2007
      • 378

      #3
      My guess would be the global variable is in memory, so regardless of how they're running it the variables should be unique.. This should be pretty simple to test out too (Store local user name in a global variable and call it to a message box, for example). But as AJ says, they should definitely be running separate files!

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        This is so important I have to re-iterate; each user must have a separate front end! Hopefully this is how you currently have it set up!

        Multiple users sharing a single, non-split database, or multiple users sharing a single front end, on a shared drive, is a surefire road to corruption. Also, this kind of setup almost always leads to timimg problems!

        Like I said, I hope you already have a front end for each user! I just add this for others who may come across this thread in the future!

        Linq ;0)>

        Comment

        • patjones
          Recognized Expert Contributor
          • Jun 2007
          • 931

          #5
          Thank you for all the replies. I do have multiple front ends set-up properly. I figured I was OK with how I was using the global variable but just wanted to make sure!

          Pat

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            No problem! In that case you should be just fine!

            Linq ;0)>

            Comment

            • schmee
              New Member
              • Dec 2011
              • 1

              #7
              Originally posted by Megalog
              My guess would be the global variable is in memory, so regardless of how they're running it the variables should be unique.. This should be pretty simple to test out too (Store local user name in a global variable and call it to a message box, for example). But as AJ says, they should definitely be running separate files!
              You are correct sir!

              I have done exactly what the seeker described, only I was forbidden to distribute fe's to various users. We've tested this thing and the one thing that hasn't blown up is the unique user info stored in a global variable.

              Sometimes you just get lucky.

              However, I stumbled across this thread because of a related question: can I find out what the value of that (or any other) variable is for any particular user? Now that would be cool.
              Last edited by NeoPa; Dec 14 '11, 05:15 PM. Reason: Fixed tags

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32661

                #8
                @Schmee
                I'm not sure what your question is, but that's ok because you can't ask it an someone-else's thread anyway. Why not formulate a question that makes sense and is clear and then we can help you (Posted in its own thread of course).

                Comment

                Working...