Solved

Validate Username and Password

Posted on 2009-05-19
2
344 Views
Last Modified: 2013-11-25
Can anyone send me the code to validate username and password and make the user navigate to a particualr form after successfull login or display error message for invalid credentials
and also to change password for the first time login users
help would be greatly appreciated

Thanks
Radhs
0
Comment
Question by:Radhs74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 24426842
Are you using User Level Security for this? Or are you trying to roll your own security/login scheme? If ULS, then DAO has several methods available, and ULS will validate users for you. To change a user password:

DAO.NewPassword "OldPass", "NewPass"

If you're rolling your own ... that's a pretty tall order, asking for a pretty much complete validation and navigation code set. It's pretty simple to validate a user against a table:

Dim rst As DAO.Recordset
Set rst = Currentdb.OpenREcordset("SELECT * FROM YourTable Where YourUserName='" & Me.SomeTextbox & "' And YourPassword='" & Me.someOtherTextbox & "'")

If Not(rst.eof and rst.bof) then
  '/user wasn't found

Else
  '/user was found - move to a form
  DoCmd.OpenForm "SomeFormName"
End if
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question