Results 1 to 6 of 6

Thread: Login

  1. #1
    Join Date
    Jun 2006
    Posts
    2

    Unanswered: Login

    I am developing an application frontend in Access with a SQL backend. The SQL server table access is based off of Domain login. What I am wanting is to create some custom application security based off of the same information. I have created a security table with the usernames from the domain and bit options for application access areas. How in VBA do I query for what the windows Username and Domain are for the person currently logged in and has the application open?

  2. #2
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    I know you can use Environ("UserName") to get the username and Environ("UserProfile") to get the users Documents and Settings folder so i would say it is something based around that?

    I dont know how you would query and verify the user against the AD though
    Based on DAO 3.6 and Access 2000 + 2003
    VB.Net 2005 + ADO.Net

  3. #3
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    From testing i think it really is as simple as Environ("UserDomain")

    I dont understand the second part of the question though, "Has the application open"? Is this just as simple as you want to check to see if the user has the program open already?
    Based on DAO 3.6 and Access 2000 + 2003
    VB.Net 2005 + ADO.Net

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Environ is hackable and not reliable. API is the way to go.
    Username (I have used):
    http://www.mvps.org/access/api/api0008.htm
    Domain (I have never used):
    http://www.mvps.org/access/api/api0040.htm

    BTW - if SQL Server is set to trusted connection why not let it deal with the security and you can handle any connection errors if they occur?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Jul 2004
    Location
    Blackburn, UK
    Posts
    169
    I never knew that about Environ, i have only ever used it for simple applications though and nothing of an authentication procedure, i have always written my own authentication procedures not based on the current logged on user.

    Thanks for the enlightening
    Based on DAO 3.6 and Access 2000 + 2003
    VB.Net 2005 + ADO.Net

  6. #6
    Join Date
    Jun 2006
    Posts
    2
    To Give You guys a better idea of what im attempting here is a program flow

    [Machine Login] --> [Access ADP Open] --> [Windows Auth to SQL] --> [FormA Loads] {OnLoad check security table for forms&reports usable}{Display available forms and reports}

    BTW thanks pootle flump that is exactly what i was looking for. And in answer to your question... dont want to make redundant tables so based off username certain data filters drop in place. ie UserA can only see customers in NY and UserB can only see customers in FL but SupervisorA can see all customers in FL & NY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •