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 https://youtu.be/s-BU03egpWA 
*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 database.it 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:https://www.youtube.com/user/sandydehrian
Computer Gyan Blog:http://selfcomputerlearning.blogspot.in/



Source Code :-
______________________________________

LOGIN FORM
_____________________________________

Private Sub cancelbtn_Click()
End
End Sub


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

End If
End Sub

Private Sub resetbtn_Click()
reset.Show
End Sub
_______________________________________

REGISTRATION FORM
_______________________________________

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
registerado.Recordset.Update
txtroll.Text = ""
txtname.Text = ""
txtuser.Text = ""
txtpass.Text = ""
txtdob.Text = ""
MsgBox "Registration Successful,Please Login with your Username and Password"
Login.Show

End Sub

Private Sub Form_Load()
registerado.Recordset.AddNew
End Sub
________________________________________

RESET FORM
________________________________________

Change Password code:-

Private Sub changepassbtn_Click()
If txtnew.Text = txtconfirm.Text Then
forgetado.Recordset.Fields("Password") = txtconfirm.Text
forgetado.Recordset.Update
MsgBox "Password Changed Successfully", vbInformation, "Password Change: Success"
reset.Hide
Login.Show
Else
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 + "'"
forgetado.Refresh
If forgetado.Recordset.EOF Then
lblmsg.Caption = "User ID Not Found ..Sorry Can't ReSet the password!!!! "
lblmsg.ForeColor = &HFF&
Else
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&
Else
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()
Registration.Show

End Sub

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

Sandeep Kaundal