Solved

Validate Username and Password

Posted on 2009-05-19
2
346 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 85

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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