PC Review


Reply
Thread Tools Rate Thread

current login

 
 
Jason
Guest
Posts: n/a
 
      18th Feb 2005
Hi,

I was wondering how i could use the current login in a textbox. I know the
currentuser() gives me e.g. 'Admin' if no security is set up.

But how can i get the login and/or hostname from windows (or if logged in
through novell)?

Greetings,

J


 
Reply With Quote
 
 
 
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      18th Feb 2005
Jason,

Not sure if this will work under Novell, but as far as Windows goes:

Environ("UserName")

will return the Windows login name.

It can be argued that environment variables are fairly easy to change,
so some advise to use an API call instead, in order to retrieve the
Windows login name. The counter-argument is that hardly any user will
know how to do that, even if they know it's being used, but if you want
to go by the book you can find the code in:

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

HTH,
Nikos

Jason wrote:
> Hi,
>
> I was wondering how i could use the current login in a textbox. I know the
> currentuser() gives me e.g. 'Admin' if no security is set up.
>
> But how can i get the login and/or hostname from windows (or if logged in
> through novell)?
>
> Greetings,
>
> J
>
>

 
Reply With Quote
 
Jason
Guest
Posts: n/a
 
      18th Feb 2005
Hi Nikos,

Thanks for tip. I agree that normal users don't know how to change it. Do
you also know to get the hostname?

Greetings,

J
"Nikos Yannacopoulos" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Jason,
>
> Not sure if this will work under Novell, but as far as Windows goes:
>
> Environ("UserName")
>
> will return the Windows login name.
>
> It can be argued that environment variables are fairly easy to change, so
> some advise to use an API call instead, in order to retrieve the Windows
> login name. The counter-argument is that hardly any user will know how to
> do that, even if they know it's being used, but if you want to go by the
> book you can find the code in:
>
> http://www.mvps.org/access/api/api0008.htm
>
> HTH,
> Nikos
>
> Jason wrote:
>> Hi,
>>
>> I was wondering how i could use the current login in a textbox. I know
>> the currentuser() gives me e.g. 'Admin' if no security is set up.
>>
>> But how can i get the login and/or hostname from windows (or if logged in
>> through novell)?
>>
>> Greetings,
>>
>> J



 
Reply With Quote
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      18th Feb 2005
Jason,

Not sure what you mean by hostname... logon server maybe? If yes, use
Environ("LOGONSERVER"). For more on the possible Environ arguments, look at:

http://blogs.officezealot.com/charle...2/10/3574.aspx

HTH,
Nikos

Jason wrote:
> Hi Nikos,
>
> Thanks for tip. I agree that normal users don't know how to change it. Do
> you also know to get the hostname?
>
> Greetings,
>
> J
> "Nikos Yannacopoulos" <(E-Mail Removed)> schreef in bericht
> news:(E-Mail Removed)...
>
>>Jason,
>>
>>Not sure if this will work under Novell, but as far as Windows goes:
>>
>>Environ("UserName")
>>
>>will return the Windows login name.
>>
>>It can be argued that environment variables are fairly easy to change, so
>>some advise to use an API call instead, in order to retrieve the Windows
>>login name. The counter-argument is that hardly any user will know how to
>>do that, even if they know it's being used, but if you want to go by the
>>book you can find the code in:
>>
>>http://www.mvps.org/access/api/api0008.htm
>>
>>HTH,
>>Nikos
>>
>>Jason wrote:
>>
>>>Hi,
>>>
>>>I was wondering how i could use the current login in a textbox. I know
>>>the currentuser() gives me e.g. 'Admin' if no security is set up.
>>>
>>>But how can i get the login and/or hostname from windows (or if logged in
>>>through novell)?
>>>
>>>Greetings,
>>>
>>>J

>
>
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      18th Feb 2005
Recognize, though, that not all of the environment variables listed in that
article necessarily exist on all machines. I stopped comparing after about 5
in the list weren't present on my machine.

Recognize, too, that it's trivial to reset any environment variable
(although doing so may cause problems on the machine)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Nikos Yannacopoulos" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jason,
>
> Not sure what you mean by hostname... logon server maybe? If yes, use
> Environ("LOGONSERVER"). For more on the possible Environ arguments, look
> at:
>
> http://blogs.officezealot.com/charle...2/10/3574.aspx
>
> HTH,
> Nikos
>
> Jason wrote:
>> Hi Nikos,
>>
>> Thanks for tip. I agree that normal users don't know how to change it. Do
>> you also know to get the hostname?
>>
>> Greetings,
>>
>> J
>> "Nikos Yannacopoulos" <(E-Mail Removed)> schreef in bericht
>> news:(E-Mail Removed)...
>>
>>>Jason,
>>>
>>>Not sure if this will work under Novell, but as far as Windows goes:
>>>
>>>Environ("UserName")
>>>
>>>will return the Windows login name.
>>>
>>>It can be argued that environment variables are fairly easy to change, so
>>>some advise to use an API call instead, in order to retrieve the Windows
>>>login name. The counter-argument is that hardly any user will know how to
>>>do that, even if they know it's being used, but if you want to go by the
>>>book you can find the code in:
>>>
>>>http://www.mvps.org/access/api/api0008.htm
>>>
>>>HTH,
>>>Nikos
>>>
>>>Jason wrote:
>>>
>>>>Hi,
>>>>
>>>>I was wondering how i could use the current login in a textbox. I know
>>>>the currentuser() gives me e.g. 'Admin' if no security is set up.
>>>>
>>>>But how can i get the login and/or hostname from windows (or if logged
>>>>in through novell)?
>>>>
>>>>Greetings,
>>>>
>>>>J

>>
>>


 
Reply With Quote
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      18th Feb 2005
Doug,

First point is fair. Second one as well, but I've already warned Jason
about it! I have to admit I don't know how to change an environment
variable, so I trust my users )whom I know) won't either. Speaking of
it, how is it done?

Thanks,
Nikos

Douglas J. Steele wrote:
> Recognize, though, that not all of the environment variables listed in that
> article necessarily exist on all machines. I stopped comparing after about 5
> in the list weren't present on my machine.
>
> Recognize, too, that it's trivial to reset any environment variable
> (although doing so may cause problems on the machine)
>

 
Reply With Quote
 
Barry-Jon
Guest
Posts: n/a
 
      18th Feb 2005
Yes - how is it done? Any way of knowing that's it's been done and use
the API call if it has?

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      18th Feb 2005
It can be as simple as opening a command prompt and issuing a Set command:

Set UserName=Phoney

There are also API calls that let you set environment variables.

If you're going to try and detect whether it's been done and use the API it
is has, why not just use the API everytime?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Barry-Jon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes - how is it done? Any way of knowing that's it's been done and use
> the API call if it has?
>



 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      18th Feb 2005
Answered elsewhere in this thread.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Nikos Yannacopoulos" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Doug,
>
> First point is fair. Second one as well, but I've already warned Jason
> about it! I have to admit I don't know how to change an environment
> variable, so I trust my users )whom I know) won't either. Speaking of it,
> how is it done?
>
> Thanks,
> Nikos
>
> Douglas J. Steele wrote:
>> Recognize, though, that not all of the environment variables listed in
>> that article necessarily exist on all machines. I stopped comparing after
>> about 5 in the list weren't present on my machine.
>>
>> Recognize, too, that it's trivial to reset any environment variable
>> (although doing so may cause problems on the machine)
>>



 
Reply With Quote
 
Nikos Yannacopoulos
Guest
Posts: n/a
 
      21st Feb 2005
Thanks Doug!

Douglas J. Steele wrote:
> It can be as simple as opening a command prompt and issuing a Set command:
>
> Set UserName=Phoney
>
> There are also API calls that let you set environment variables.
>
> If you're going to try and detect whether it's been done and use the API it
> is has, why not just use the API everytime?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Role of current windows login user Mark White Microsoft C# .NET 8 16th Jan 2006 05:18 PM
Fixed Impersonation vs Current login user Roan Schuurman Microsoft Dot NET 1 11th May 2004 04:51 PM
Modify the Current User reg key with a login script? Scott Microsoft Windows 2000 Registry 1 15th Sep 2003 11:08 PM
Modify the Current User reg key with a login script? Scott Microsoft Windows 2000 Registry Archive 2 15th Sep 2003 11:08 PM
Current time error stops login Richard R. Lambert Windows XP Networking 1 13th Aug 2003 07:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:49 AM.