Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password interegation

Status
Not open for further replies.

Djbell

IS-IT--Management
Apr 22, 2002
175
GB
Hi

I have a database that uses the Username of the person that is logged onto my Windows 2000 network. What I would like to do is create a button that opens a text box to allow them to type a password, on clicking OK I want that password to be checked with the users network password, if it is the same then I want it to open a form else, I want a message box stating that they do not have the correct authorisation to open that form.

Is this possible

Djbell
 
DJ,

I'm sure there is a way to do this, though I would guess that it's quite complex to retrieve a network password. It would probably be a _lot_ simpler to just get into Access security and use that for what you need. The MS Access Security faq will tell you just about everything you could hope to know about the subject, though most people have to read it two or three times to catch everything. I've got a copy on my website, or you can get it at from MS.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
To retrieve a Windows password, try the following:

Paste this declaration and function into the declarations section of a module:
Code:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Property Get UserName() As String
  Dim strUser As String * 100
    
  GetUserName strUser, 100
  UserName = Trim(strUser & "")
  
End Property

Call it from your code as:

x = UserName()


 
Yah, quite a difference b/w getting the username and the pwd!! =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top