By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,479 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Recording WIF users against their entries

P: n/a
Hi,

Thanks in advance for any assistance regarding my question.

I have setup a database with a WIF containing the usernames and p/words
of several unique data entry operators who will be entering data into
the database.

I would like to know how I record the username of each unique data
entry operator against any entries they input into the database?

Because I have a WIF setup each data entry operator must 'log-in' to
the database to enter data - I'm just not sure how to grab these log-in
details and record them against the operator's input.

If I need to code this is, what would the code look like (roughly) ?
And where would I need to write it?

Many thanks
Chris

Aug 30 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Hi Chris,

If you cut and paste the following code in to the debug window it will
return the windows login.

? Environ("UserName")

This can be user in code, albeit minus the ?

Good luck

Nick

ch***********@anu.edu.au wrote:
Hi,

Thanks in advance for any assistance regarding my question.

I have setup a database with a WIF containing the usernames and p/words
of several unique data entry operators who will be entering data into
the database.

I would like to know how I record the username of each unique data
entry operator against any entries they input into the database?

Because I have a WIF setup each data entry operator must 'log-in' to
the database to enter data - I'm just not sure how to grab these log-in
details and record them against the operator's input.

If I need to code this is, what would the code look like (roughly) ?
And where would I need to write it?

Many thanks
Chris
Aug 30 '06 #2

P: n/a
<ch***********@anu.edu.auwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi,

Thanks in advance for any assistance regarding my question.

I have setup a database with a WIF containing the usernames and p/words
of several unique data entry operators who will be entering data into
the database.

I would like to know how I record the username of each unique data
entry operator against any entries they input into the database?

Because I have a WIF setup each data entry operator must 'log-in' to
the database to enter data - I'm just not sure how to grab these log-in
details and record them against the operator's input.

If I need to code this is, what would the code look like (roughly) ?
And where would I need to write it?

Many thanks
Chris
The CurrentUser() function returns the name of the account currently logged
on to the database.

Keith.
www.keithwilby.com
Aug 30 '06 #3

P: n/a
WILBY...! CurrentUser returns "Admin" most of the time.

However, that Environ trick is pretty cool, I used to use a WScript
call but I think I'll go that route from now on.

Keith Wilby wrote:
The CurrentUser() function returns the name of the account currently logged
on to the database.

Keith.
www.keithwilby.com
Aug 30 '06 #4

P: n/a

"ManningFan" <ma********@gmail.comschreef in bericht news:11**********************@i42g2000cwa.googlegr oups.com...
WILBY...! CurrentUser returns "Admin" most of the time.

However, that Environ trick is pretty cool, I used to use a WScript
call but I think I'll go that route from now on.
Funny Man !! (Or stupid man ??)
Using WScript is always a bad idea in my opinion!!
Allowing the use is also a bad idea in my opinion!!
So depending on WScript in an Access application is a bad idea.
Lots of sys-admins in my regio here won't allow it.

BUT the point of this post is:
CurrentUser() will always return 'Admn' when NO security is applied....

The OP asked a question about users loggin into the db with User-level-security applied
(WIF=Workgroup Information File I guess ??)

-- Environ("UserName") gives the name of the Windows login as Nick already answered.
-- CurrentUser() gives the name of the user currently logged-on to the Access (secured) mdb as Keith already answered.
Two different animals IMO.

Arno R
Aug 30 '06 #5

P: n/a
Arno - Your advice is... well... Worthless. But thanks for playing.

Arno R wrote:
Funny Man !! (Or stupid man ??)
Using WScript is always a bad idea in my opinion!!
Allowing the use is also a bad idea in my opinion!!
So depending on WScript in an Access application is a bad idea.
Lots of sys-admins in my regio here won't allow it.

BUT the point of this post is:
CurrentUser() will always return 'Admn' when NO security is applied....

The OP asked a question about users loggin into the db with User-level-security applied
(WIF=Workgroup Information File I guess ??)

-- Environ("UserName") gives the name of the Windows login as Nick already answered.
-- CurrentUser() gives the name of the user currently logged-on to the Access (secured) mdb as Keith already answered.
Two different animals IMO.

Arno R
Aug 30 '06 #6

P: n/a

ManningFan wrote:
Arno - Your advice is... well... Worthless. But thanks for playing.
Really? I beg to differ. What are you so hostile for? If someone
knows an answer, I'll take it. I'm not shy. What's the big deal?
There are lots of folks here that will always be better at this than I
am. That's life. What's the point in getting bent out of shape about
it?

Aug 30 '06 #7

P: n/a
The guy comes out of left field and calls me "stupid man", and you
think _I'M_ bent out of shape? If WScript should "never be used", then
why are there MVP pages about it? The guy insulted me and offered bad
advice, he deserves the tongue-lashing he got.

pi********@hotmail.com wrote:
ManningFan wrote:
Arno - Your advice is... well... Worthless. But thanks for playing.
Really? I beg to differ. What are you so hostile for? If someone
knows an answer, I'll take it. I'm not shy. What's the big deal?
There are lots of folks here that will always be better at this than I
am. That's life. What's the point in getting bent out of shape about
it?
Aug 30 '06 #8

P: n/a
"ManningFan" <ma********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Arno - Your advice is... well... Worthless. But thanks for playing.
Talk about calling the kettle black here. What you talking about?

The user stated that they are using workgroup files, and assign logons to
ms-access users...
>WILBY...! CurrentUser returns "Admin" most of the time.
Again, talk about worthless advice. Did you not bother to read the post? If
you assigning user names, then IT WILL BE A COLD DAY IN HELL THAT THE LOGON
name will be Admin. IT WILL NOT BE "AMDIN" MOST OF THE TIME. It be a very
rare event. So, now, who exactly is giving useless advice here?

If fact, if the user has secured the workgroup file correctly, then likely
the admin logon has little, or no privileges. Don't confuse the admin logon
with that of admins "group" privileges.

Further, the suggesting to use environment valuables is not a very good one.
Batch files, windows start-up settings and even USERS can edit/change the
environment values. You are aware that you can go right click on "my
computer". Click on the advanced tab, and at the bottom you will a button to
"edit" environment variables.

In other words, a user can create a logon environment value, and IT WILL
HAVE NO RELATION TO THAT ACTUAL windows logon.

And, the advice about using scripts is also really good, as many companies
do lock down their computers..and do not allow the use of windows scripts.

So, what is left if you need to grab the windows user logon?

Well, as mentioned, if users have password windows logons, the use of
environment variables is not very good, as any user can go and use the above
advice to create a environment value and assigning it ANY VALUE they want.

So, your environment value in this case will NOT match the windows logon.

The recommend solution is to use the windows user api. ms-access examples
can be found here:

You can get the current network logon name with:

http://www.mvps.org/access/api/api0008.htm

And, the current computer name with:

http://www.mvps.org/access/api/api0009.htm

And, if using ms-access security, then currentuser() will return the
ms-access logon.

I often log all 3 of the above values in some applications.

So, not only is your advice 100% wrong on what value currentuser() will
return IN THIS CASE!!!, the advice to use scripts is not very good either.
and, father, the advice to use environment values is also not very good, as
once again they can be changed. I can change my environment values to your
user logon...but, if I don't have your password, I certainly can't log on as
you. So, using the above api's are faster, more reliable (they will work all
the way back to windows 95, and also work in windows Vista - that can't be
said for environment variables). And, not only are the api's time and tested
over the last 10 years, they are also not subject to tampering with as
compared to environment values

So, as I read your response, it is fine that you made a mistake, or perhaps
did not realise that the person was using workgroup files (you should be big
enough to just simply admit you made mistake). However, your other two
pieces of advice (using scripts), and using environment values are also of
dubious value, and especially so when MUCH better choices such as the api's
exist.

What not just admit you make a mistake here, and the advice you gave was
really not very good here?

Or, if you have better information, please explain to me how, or why that
"most of the time" currentUser() will return admin when using a secured
application ?

I am all open to learning here....and you should also address the issue that
environment values can be easily changed, where the above api's cannot be
tampered with...

This newsgroup is a great place to learn new things...you just have to be
more open to the suggestions here...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Aug 30 '06 #9

P: n/a

"ManningFan" <ma********@gmail.comschreef in bericht news:11*********************@74g2000cwt.googlegrou ps.com...
The guy comes out of left field and calls me "stupid man", and you
think _I'M_ bent out of shape? If WScript should "never be used", then
why are there MVP pages about it? The guy insulted me and offered bad
advice, he deserves the tongue-lashing he got.
Who offered bad advice ??
Seems to be *your* daily play.

So when *you* insult people here, you deserve what ??

Arno R
Aug 30 '06 #10

P: n/a
"Arno R" <ar***********@tiscali.nlwrote in message
news:44**********************@text.nova.planet.nl. ..

Funny Man !! (Or stupid man ??)

Hi Arno. It would appear that FanningMan is from the same stable as PCD but
without the adverts. I plonked him last week, many others have also done so
I believe. I think ignoring the ignorant is a good idea. The FanningMan is
doing just that, fanning the flames of ignorance and stupidity, hence the
blind faith in the Environ property.

Regards,
Keith.
Aug 31 '06 #11

P: n/a
Holy Third Grade, Batman! Not the old "change the username to try to
ridicule him" and *plonk* tactics! I somehow feel humanity let me down
today...

Keith Wilby wrote:
Hi Arno. It would appear that FanningMan is from the same stable as PCD but
without the adverts. I plonked him last week, many others have also done so
I believe. I think ignoring the ignorant is a good idea. The FanningMan is
doing just that, fanning the flames of ignorance and stupidity, hence the
blind faith in the Environ property.

Regards,
Keith.
Aug 31 '06 #12

P: n/a
Children Children Children

Stop all this bickering.

I gave the quick easy way to do this, now if somebody, and Albert
obviously has a better way of doing it then, great! Maybe I can learn
something from him.

All this petty infighting really is beneath all of you.

And I don't want to see a message 'Well he started it'.

But in ManningFan defense Arno R did pay him a personal insult.

Grow up, all of you.

Nick
ManningFan wrote:
Holy Third Grade, Batman! Not the old "change the username to try to
ridicule him" and *plonk* tactics! I somehow feel humanity let me down
today...

Keith Wilby wrote:
Hi Arno. It would appear that FanningMan is from the same stable as PCD but
without the adverts. I plonked him last week, many others have also done so
I believe. I think ignoring the ignorant is a good idea. The FanningMan is
doing just that, fanning the flames of ignorance and stupidity, hence the
blind faith in the Environ property.

Regards,
Keith.
Sep 8 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.