473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Global variable values when running multiple instances of a DB

patjones
931 Expert 512MB
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
Dec 11 '09 #1
7 3176
ajalwaysus
266 Expert 100+
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
Dec 11 '09 #2
Megalog
378 Expert 256MB
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!
Dec 11 '09 #3
missinglinq
3,532 Expert 2GB
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)>
Dec 11 '09 #4
patjones
931 Expert 512MB
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
Dec 11 '09 #5
missinglinq
3,532 Expert 2GB
No problem! In that case you should be just fine!

Linq ;0)>
Dec 11 '09 #6
schmee
1
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.
Dec 14 '11 #7
NeoPa
32,556 Expert Mod 16PB
@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).
Dec 14 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
33
by: MLH | last post by:
I've read some posts indicating that having tons of GV's in an Access app is a bad idea. Personally, I love GVs and I use them (possibly abuse them) all the time for everything imaginable - have...
7
by: Michael | last post by:
Hi newsgroup, as the subject indicates I am looking for an advice using global variables. I am not if this problem is more about style then C. If its wrong in thi group, sorry. So I have a...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
3
by: CsProviders | last post by:
i am a newbie to .net programming, i am having problem with global data and form instanciation. My questions are How do i maintain global data in windows forms applications? How do i navigate from...
24
by: onnodb | last post by:
Hi all, Currently, I'm working on an Access XP database app that uses two global objects in its code. These two objects are instances of "controller classes". For example, one of them manages...
8
by: yinglcs | last post by:
Hi, I read this article about global variable in c: http://www.phim.unibe.ch/comp_doc/c_manual/C/SYNTAX/glo_int_vars.html But I have a few questions 1. how can I declare the global variable...
11
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global"...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.