Saturday, 16 July 2016

How to Reset Forgot Password in Visual Basic 6 0/MS Access Login Applica...

How to Reset Forgot Password in Visual Basic 6 0/MS Access Login Application-Step by Step-Visual Basic 6.0 Database Tutorial.
In this tutorial, following features are discussed
First, I am using my earlier Login Application 
*How to make database connectivity with access database for Reset Form.
* How to check the existing User of the application, Whether User credentials are available in the database or not. It gives message according to the availability user.
*How to verify or authenticate the user by entering the date of birth which is registered while registration of the account using Login System.
*Once Date of birth is verified with the generates message accordingly showing Full name of the user and Reset Password option is available where you can enter your new password.
* if Date of Birth is not verified ,then You cannot see the Reset Password option on the form and not able to change the password anymore.
*When you see the password reset option, Here you have to provide New Password and retype to confirm the same password.
if New and confirm password matches with each other ,then you will be able to change the password by clicking Change Password button otherwise it gives warning msg:Password not matched.
*Once you successfully change the password, now you can Login into the system with your New Password.

For more information and Demo, Please watch the video and Note down each step.You can also make the same application without any error.
for more Visual Basic tutorials,please visit
Youtube Channel:
Computer Gyan Blog:

Source Code :-


Private Sub cancelbtn_Click()
End Sub

Private Sub loginbtn_Click()
loginado.RecordSource = "select * from Logintb where Username='" + txtuser.Text + "' and Password='" + txtpass.Text + "'"
If loginado.Recordset.EOF Then
MsgBox "Login failed,Try Again..!!!", vbCritical, "Please Enter correct Username and Password"
MsgBox "Login Successful.", vbInformation, "Successful Attempt"

End If
End Sub

Private Sub resetbtn_Click()
End Sub


Private Sub Command1_Click()
registerado.Recordset.Fields("RollNo") = txtroll.Text
registerado.Recordset.Fields("Name") = txtname.Text
registerado.Recordset.Fields("Username") = txtuser.Text
registerado.Recordset.Fields("Password") = txtpass.Text
registerado.Recordset.Fields("DOB") = txtdob.Text
txtroll.Text = ""
txtname.Text = ""
txtuser.Text = ""
txtpass.Text = ""
txtdob.Text = ""
MsgBox "Registration Successful,Please Login with your Username and Password"

End Sub

Private Sub Form_Load()
End Sub


Change Password code:-

Private Sub changepassbtn_Click()
If txtnew.Text = txtconfirm.Text Then
forgetado.Recordset.Fields("Password") = txtconfirm.Text
MsgBox "Password Changed Successfully", vbInformation, "Password Change: Success"
MsgBox "Password Does not matched,Please Enter Correct Details", vbExclamation, "Change Password:Failed"
txtnew.Text = ""
txtconfirm.Text = ""
End If
End Sub

Check User code:-

Private Sub checkbtn_Click()
forgetado.RecordSource = "Select * from Logintb where username='" + txtuserid.Text + "'"
If forgetado.Recordset.EOF Then
lblmsg.Caption = "User ID Not Found ..Sorry Can't ReSet the password!!!! "
lblmsg.ForeColor = &HFF&
lblmsg.Caption = "User ID Found in the database"
lblmsg.ForeColor = &H8000&
End If
End Sub

Form Load:-

Private Sub Form_Load()
txtnew.Visible = False
txtconfirm.Visible = False
changepassbtn.Visible = False
Label3.Visible = False
Label4.Visible = False
End Sub

Verification Code:-

Private Sub verifybtn_Click()
Dim str As String
str = StrComp(forgetado.Recordset.Fields("DOB").Value, txtdate.Text, vbTextCompare)
If str = True Then
lblmsg1.Caption = "Account not verified ,Can't reset the password"
lblmsg.Caption = "Sorry .. Date of Birth Not Matched !! "
lblmsg.ForeColor = &HFF&
lblmsg1.ForeColor = &HFF&
lblmsg.ForeColor = &H8000&
lblmsg1.ForeColor = &H8000&
lblmsg.Caption = "Congratulations !!"
lblname.Caption = forgetado.Recordset.Fields("Name")
lblname.ForeColor = &HFF&
lblmsg1.Caption = "Account is verified Now,Set your new Password"
txtnew.Visible = True
txtconfirm.Visible = True
changepassbtn.Visible = True
Label3.Visible = True
Label4.Visible = True
End If
End Sub

Option for Login or Registration
Private Sub Command1_Click()

End Sub

Private Sub Command2_Click()
End Sub
Please Share and Subscribe to my youtube channel.
Don't fogot to hit LIKE button if you like my work.

Sandeep Kaundal