We help IT Professionals succeed at work.

MS Access 2003 - Determine User ID from System when User opens MS access Application

Lou Dufresne
Lou Dufresne asked
on
I have a MS Access 2003 Application that the user opens and then can submit innformation and do other business while in my MS Access application.

I would like to determmine the user ID from the server when the user opens the MS Access 2003 application without having the user enter a login id.

Question: What code or process can I use to determine who is logging into my MS Application when the user opens the MS Access 2003.

Thank you for your guidance.
Ldufresne
 
 
Comment
Watch Question

Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
environ("username")
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010
Commented:
There is an API call you can call too, but using environ is easier.
President / Owner
Fellow 2019
Most Valuable Expert 2017
Commented:
API is the ticket.  Environ can be gotten around easily.  See:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_23071163.html

Jim.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
Jim,

By "gotten around" do you mean that an unscrupulous person can change the value of that environment variable, and thereby potentially bypass security measures that are keyed to it?
Jim Dettman (EE MVE)President / Owner
Fellow 2019
Most Valuable Expert 2017

Commented:
<<By "gotten around" do you mean that an unscrupulous person can change the value of that environment variable, and thereby potentially bypass security measures that are keyed to it? >>

 Yup.

Jim.
Jim Dettman (EE MVE)President / Owner
Fellow 2019
Most Valuable Expert 2017

Commented:
and BTW, sorry about posting basically a dup comment.  I didn't realize that "API Call" in your comment was an actual link.

  Thought it was one of those words that automatically gets recongized as a term and under linned (visiting too many web sites lately).

Jim.
Top Expert 2011

Commented:
I agree with Jim that the API method is the most secure/accurate way.
Lou DufresneScrum Master / Technical Business Analyst

Author

Commented:
Both of these solutions provided me with the best way to accomplish what I need to do. "Fyed" gave the group the sugestion about API and JDettman provided me the link on how to code it .
Jim Dettman (EE MVE)President / Owner
Fellow 2019
Most Valuable Expert 2017

Commented:

 Actually, fyed also give you a link to some code on the MVP site, although it's not obvious from the comment.

  If you click on it, you will get to the MVP site where you will find code similar to what I posted.

  Would you like the question re-opened so you can assign fyed the solution?

Jim.
Jim Dettman (EE MVE)President / Owner
Fellow 2019
Most Valuable Expert 2017

Commented:

  Just saw that the MVP code is only for the username.  My code does both username and computer name.  Probably want to stick with that.

Jim.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
Jim,

Stop being so galant and just accept the points!

Dale
Jim Dettman (EE MVE)President / Owner
Fellow 2019
Most Valuable Expert 2017

Commented:
Dale,

  Fair is fair... you were there first.

Jim.
Lou DufresneScrum Master / Technical Business Analyst

Author

Commented:
Thanks guy for the extra entertainment.

Ldufresne19