473,394 Members | 1,371 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,394 software developers and data experts.

Persistence

mb
Hi,

what would be the best way to store a user id etc..for a multiple user
db ... and then be able to access that userid at various points in the
app ??

e.g.

user signs in with id of USER001

I want to be able to access that variable when, for example, that user
adds records to a table to track who added what ...

any help appreciated..

Feb 1 '06 #1
6 1936
"mb" <mb**@bigfoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

what would be the best way to store a user id etc..for a multiple user
db ... and then be able to access that userid at various points in the
app ??

e.g.

user signs in with id of USER001

I want to be able to access that variable when, for example, that user
adds records to a table to track who added what ...

any help appreciated..

Access a variable when a user adds a record? I don't understand that
concept at all but you can set up a log of changes made by adding some
coding in the form's Current event. Functions you will need include Now(),
CurrentUser() and Environ (see the help for more info). You would need to
loop through all relevant controls on the form and determine which one(s)
has (have) been changed (old/new value properties) which you can then record
in a table.

Not too detailed I know but it should set you off in the right direction.

Keith.
www.keithwilby.com
Feb 1 '06 #2
You can persist the value in a number of ways e.g.:-
Global variable
Database property
Field in a table
An external file
The registry
Control on a form
...

and so on.

Personally, as you are using a database I would go with a field in a table,
which you can then update as appropriate and recall at any time.
--

Terry Kreft
"mb" <mb**@bigfoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

what would be the best way to store a user id etc..for a multiple user
db ... and then be able to access that userid at various points in the
app ??

e.g.

user signs in with id of USER001

I want to be able to access that variable when, for example, that user
adds records to a table to track who added what ...

any help appreciated..

Feb 1 '06 #3
"mb" <mb**@bigfoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

what would be the best way to store a user id etc..for a multiple user
db ... and then be able to access that userid at various points in the
app ??

e.g.

user signs in with id of USER001

I want to be able to access that variable when, for example, that user
adds records to a table to track who added what ...

any help appreciated..

When you say "signs in" does this mean some form of login screen? If so,
you could have it so the OK button hides this screen if the login is
successful. Then at any point you can get the value by asking for
Forms!frmLogin.txtUserID.
Feb 1 '06 #4
As an alternative, you will find the Windows API code to retrieve the user's
network login id at http://www.mvps.org/access/api/api0008.htm and the
current computer name at http://www.mvps.org/access/api/api0008.htm. If you
do that, you will identify the user without:

-- having the user log on again, separately
-- having to climb the learning curve, which is substantial, to implement
Access' own security (and, see above), or
-- having a security lite, which is easily defeatable -- the network id
has its own, less easily defeatable, security.

Larry Linson
Microsoft Access MVP

"mb" <mb**@bigfoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

what would be the best way to store a user id etc..for a multiple user
db ... and then be able to access that userid at various points in the
app ??

e.g.

user signs in with id of USER001

I want to be able to access that variable when, for example, that user
adds records to a table to track who added what ...

any help appreciated..

Feb 1 '06 #5
I have created several databases where the user identifies himself to
the application by a login-like screen. Upon successful identification,
I did several things:

1. Made an entry in a login history table.
2. Set a global variable to the user's ID (lngCurrentUserID)

In order to easily recall the user id for queries and reports, I
created a very simple function to return the value of the global
variable:

Public Function CurrentUserID () as Long

CurrentUserID = lngCurrentUserID

End Function

Hope this is helpful,

RustyMorr

Feb 2 '06 #6
I have created several databases where the user identifies himself to
the application by a login-like screen. Upon successful identification,
I did several things:

1. Made an entry in a login history table.
2. Set a global variable to the user's ID (lngCurrentUserID)

In order to easily recall the user id for queries and reports, I
created a very simple function to return the value of the global
variable:

Public Function CurrentUserID () as Long

CurrentUserID = lngCurrentUserID

End Function

Hope this is helpful,

RustyMorr

Feb 2 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PerfectDayToChaseTornados | last post by:
Hi All, I'm interested in peoples opinions & experiences of various persistence frameworks. I mainly use EJB2 or straight JDBC for persistence, but have been looking at various alternative...
2
by: Frank Grimm | last post by:
Hi group, i'm looking for a Java persistence framework that is able to cope with changes of the class source, i.e. new/changed attributes and/or methods. Say you have an exported (persistent)...
6
by: Mark Carter | last post by:
I had a play with XML-RPC the other day, and it seemed really simple to use; which really made an impression on me. But you can't make data persist on the server (not without rolling your own...
6
by: Paolo Losi | last post by:
Hi all, I'm pretty new to the python language so please excuse me if this is FAQ... I'm very glad to be part of the list! :-) I'm looking into a way to implement a generic workflow framework...
0
by: Sergei Gnezdov | last post by:
What are the options in persistence area if I want to use .Net? I am interested to know about commercial quality products such as Toplink. My overall impression was that .Net is far behind in...
1
by: Joe | last post by:
I was wondering if there are any recommended persistence frameworks for use in .NET that could be recommended. I am looking for the following requirements: Free/Open Source or very inexpensive....
10
by: Simon Harvey | last post by:
Hi everyone, Can anyone tell me if I declare a global variable in my pages code behind, is it persisted if the page does a post back, or do I need to add the object to the session object in...
2
by: dkode | last post by:
Hello, I am laying out the architecture for a very large website that will scale to a very large degree. I have a couple of questions before I attempt to go and implement a Broker/Persistence...
5
by: Chris Spencer | last post by:
Before I get too carried away with something that's probably unnecessary, please allow me to throw around some ideas. I've been looking for a method of transparent, scalable, and human-readable...
0
myusernotyours
by: myusernotyours | last post by:
Hi all, Am trying to create a Java Desktop App that uses Java Persistence in Netbeans. The database is MS Access but I tried with Mysql and got the same error. When I run the app( Create the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.