Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba.ado
Thread: How do I get the Windows User ID

How do I get the Windows User ID
Ray Milhon 12/10/2008 6:16:00 PM
I have an unsecured Access 2000 Database. I need to track the user's that
add new and edit old data. (new requirement) I know there is a dll that can
be used to get the Windows User information and I would like to use that to
save the user info. It's been quite a while since I've done that and I've
forgotten the syntax any help would be appreciated.
Re: How do I get the Windows User ID
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 12/10/2008 7:14:12 PM
http://www.mvps.org/access/api/api0008.htm at "The Access Web"

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


"Ray Milhon" <RayMilhon[ at ]discussions.microsoft.com> wrote in message
news:DCDAD81E-9C15-42D4-A3A4-9BBC2989FF82[ at ]microsoft.com...
[Quoted Text]
>I have an unsecured Access 2000 Database. I need to track the user's that
> add new and edit old data. (new requirement) I know there is a dll that
> can
> be used to get the Windows User information and I would like to use that
> to
> save the user info. It's been quite a while since I've done that and I've
> forgotten the syntax any help would be appreciated.


RE: How do I get the Windows User ID
IgaJim 12/11/2008 7:21:22 AM
Try this:

Function UNameWindows() As String
UNameWindows = Environ("USERNAME")
End Function

another helpful function:
Function TempDirectory() As String
TempDirectory = Environ("TEMP")
End Function
Re: How do I get the Windows User ID
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 12/11/2008 1:23:14 PM
I always cringe when someone suggests using the Environ function to retrieve
the user ID, given how easy it is to reset environment variables.

The API approach to which I pointed is almost as simple, and is guaranteed
to be correct.

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


"IgaJim" <IgaJim[ at ]discussions.microsoft.com> wrote in message
news:149CBC73-AA13-4F5A-ABFE-15BA930F5351[ at ]microsoft.com...
[Quoted Text]
> Try this:
>
> Function UNameWindows() As String
> UNameWindows = Environ("USERNAME")
> End Function
>
> another helpful function:
> Function TempDirectory() As String
> TempDirectory = Environ("TEMP")
> End Function


Re: How do I get the Windows User ID
IgaJim 12/11/2008 2:24:04 PM
Oops, Sorry for the cringe Doug :D

"Douglas J. Steele" wrote:

[Quoted Text]
> I always cringe when someone suggests using the Environ function to retrieve
> the user ID, given how easy it is to reset environment variables.

Home | Search | Terms | Imprint
Newsgroups Reader