Accessing data

S

Shell

When I navigate to Help about in any office product I get
This product is licensed to: gwashington

NOTE: gwashington is just an example.

When i use the API call in Access GetUserName, I get gwashington.

HOWEVER, When I do control+alt+delete (the task manager) I get

George Washington is logged on as DOMAIN\gwashington

In code how do I get George Washington?


Thanks
 
M

Maurice

By using the environ method Dennis means implement it as follows:

environ("username")

hth
 
D

Douglas J. Steele

See http://www.mvps.org/access/api/api0066.htm at "The Access Web".

I'm unaware of any environment variable that will give you this information,
so I'd ignore the other advice. Besides, environment variables are trivial
to reset, so shouldn't be trusted for authentication purposes.
 
M

Maurice

Doug,

I agree when you want to use this for authentication or logging. But for
just getting an username this one line does the trick. What I mean is why
implement all that code if just what you might need is the username.
 
D

Douglas J. Steele

But Environ("username") will return gwashington, the network ID, and Shell
wants the user's name George Washington.

As I stated, there isn't an environment variable that will give you the
user's actual name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top