Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    214

    Talking Unanswered: DB with same User Name and Password as Windows

    I don't know if this can even be done, but can I have my password for each of the users in my db to link up to the password on Windows?
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  2. #2
    Join Date
    Feb 2004
    Posts
    214
    Sorry, my pc locked up. I didn't know it was going to post 3 times.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  3. #3
    Join Date
    May 2008
    Location
    Raleigh, NC
    Posts
    151

    I think....

    I'm pretty sure there is code or software out there that will do that, but I don't remember exactly what it was.

    I do know you might want to try something similar tho. You can use the 'GetUserName' call and function to get the window's user name. You can then bounce that against a table of 'authorized users' upon the db startup. If the window's name is in the table, the db will open, if it is not you can display a message and close it back down. I think it would basically accomplish the same thing you're looking to do, unless of course you just want to make them type in a password an additional time.

    Below is what I use to get the name.

    Declare Function GetUserName& Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long)

    Option Compare Database
    Option Explicit

    Public Function GetUser() As String
    Dim lngVal As Long
    Dim lngLength As Long
    Dim strUser As String

    lngLength = 19
    strUser = String$(20, 0)
    lngVal = GetUserName(strUser, lngLength)

    GetUser = Left$(strUser, lngLength - 1)

    End Function

    Good luck, Stu
    --If its free, take it for what its worth!

  4. #4
    Join Date
    Feb 2004
    Posts
    214

    ...

    Thanks for the info and code. I was hoping to avoid creating my own permissions and be able to use User/Security Permissions built into Access, but I may have to go this route in the end.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

Posting Permissions

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