Solved

Validate Username and Password

Posted on 2009-05-19
2
340 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
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now