Get Windows User

Discussion in 'Microsoft Access ADP SQL Server' started by Dimitris Nikolakakis, Nov 23, 2007.

  1. I would like to keep in each record of table in access project the Windows
    User and Compauter Name that has created the record or modified the record.
    I will write the code in form properties on an event.

    Thanks in advance

    Dimitris Nikolakakis
     
    Dimitris Nikolakakis, Nov 23, 2007
    #1
    1. Advertisements

  2. On Fri, 23 Nov 2007 15:00:13 +0200, "Dimitris Nikolakakis"
    <> wrote:

    Both items are listed here:
    http://www.mvps.org/access/api/index.html

    -Tom.



    >I would like to keep in each record of table in access project the Windows
    >User and Compauter Name that has created the record or modified the record.
    >I will write the code in form properties on an event.
    >
    >Thanks in advance
    >
    >Dimitris Nikolakakis
    >
     
    Tom van Stiphout, Nov 23, 2007
    #2
    1. Advertisements

  3. On SQL-Server, you can also use the function SUSER_SNAME; see:
    http://technet.microsoft.com/en-us/library/ms174427.aspx

    --
    Sylvain Lafontaine, ing.
    MVP - Technologies Virtual-PC
    E-mail: sylvain aei ca (fill the blanks, no spam please)


    "Tom van Stiphout" <> wrote in message
    news:...
    > On Fri, 23 Nov 2007 15:00:13 +0200, "Dimitris Nikolakakis"
    > <> wrote:
    >
    > Both items are listed here:
    > http://www.mvps.org/access/api/index.html
    >
    > -Tom.
    >
    >
    >
    >>I would like to keep in each record of table in access project the Windows
    >>User and Compauter Name that has created the record or modified the
    >>record.
    >>I will write the code in form properties on an event.
    >>
    >>Thanks in advance
    >>
    >>Dimitris Nikolakakis
    >>
     
    Sylvain Lafontaine, Nov 23, 2007
    #3
  4. Dimitris Nikolakakis

    jordan king Guest

    If you want an easy way to access some system variables on the workstation
    look at the Environ varaibles avialable to access.

    COMPUTERNAME
    USERNAME
    USERDOMAIN
    etc...


    I personally capture this data once the project is opened, into hidden
    values on a main switchboard, then refrence these when passing parameters to
    sql server procedures.
    "Dimitris Nikolakakis" wrote:

    > I would like to keep in each record of table in access project the Windows
    > User and Compauter Name that has created the record or modified the record.
    > I will write the code in form properties on an event.
    >
    > Thanks in advance
    >
    > Dimitris Nikolakakis
    >
    >
    >
     
    jordan king, Nov 23, 2007
    #4
  5. I always cringe when people suggest using an environment variable for this
    purpose, given how easy it is to reset an environment variable.

    All that's necessary is to open a DOS box, use the SET command to set the
    USERNAME variable to whatever you want, then open Access using a command
    line in that same DOS box. While the USERNAME isn't actually reset, it is
    for the duration of that DOS box, so Access will see whatever the user tells
    it to see.

    Far safer, in my opinion, is to use the GetUserName API call. See
    http://www.mvps.org/access/api/api0008.htm at "The Access Web" for a
    complete sample.

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


    "jordan king" <jordan > wrote in message
    news:...
    > If you want an easy way to access some system variables on the workstation
    > look at the Environ varaibles avialable to access.
    >
    > COMPUTERNAME
    > USERNAME
    > USERDOMAIN
    > etc...
    >
    >
    > I personally capture this data once the project is opened, into hidden
    > values on a main switchboard, then refrence these when passing parameters
    > to
    > sql server procedures.
    > "Dimitris Nikolakakis" wrote:
    >
    >> I would like to keep in each record of table in access project the
    >> Windows
    >> User and Compauter Name that has created the record or modified the
    >> record.
    >> I will write the code in form properties on an event.
    >>
    >> Thanks in advance
    >>
    >> Dimitris Nikolakakis
    >>
    >>
    >>
     
    Douglas J. Steele, Nov 23, 2007
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Bischof

    Input Parameters get deleted

    Brian Bischof, Jul 18, 2003, in forum: Microsoft Access ADP SQL Server
    Replies:
    1
    Views:
    516
    Vadim Rapp
    Jul 18, 2003
  2. Steven Burn

    get pirtated softwres

    Steven Burn, Aug 4, 2003, in forum: Microsoft Access ADP SQL Server
    Replies:
    2
    Views:
    466
    Simon Harvey
    Aug 5, 2003
  3. Rudi K.

    How to get Windows Username ?

    Rudi K., Jul 6, 2004, in forum: Microsoft Access ADP SQL Server
    Replies:
    2
    Views:
    242
    Guest
    Jul 7, 2004
  4. Adrian

    Write conflict - one user overwriting another user's changes

    Adrian, Jul 9, 2004, in forum: Microsoft Access ADP SQL Server
    Replies:
    0
    Views:
    226
    Adrian
    Jul 9, 2004
  5. Guest

    Windows Authentication with non current user name

    Guest, Oct 31, 2005, in forum: Microsoft Access ADP SQL Server
    Replies:
    9
    Views:
    384
Loading...

Share This Page