Public Class PasswordForm
Public nCounter As Integer click this —->>>
” This color RED text used to count the wrong access/input by the user. If he/she input more than 3 times, the program will automatically close ”
Private Sub btnpassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
” The VIOLET text used to access your database/Microsoft Access
Dim oRow As DataRow
If Me.txtuser.Text = “” Then
MsgBox(”Please Encode the User!”, MsgBoxStyle.Critical, “CONFIRM USER”)
Me.lbldisply.Text = “Empty User!!!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
ElseIf Me.txtpassword.Text = “” Then
MsgBox(”Please Encode the Password!”, MsgBoxStyle.Critical, “CONFIRM PASSWORD”)
Me.lbldisply.Text = “Empty Password!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
Else
For Each oRow In Me.RECORDSDataSet.PASS
If (oRow.Item(”userid”) = Me.txtuser.Text) Then
If (oRow.Item(”password”) = Me.txtpassword.Text) Then
Form1.bAccess = True
End If
End If
Next
If Form1.bAccess = True Then
Me.Close()
End If
Else
MsgBox(”Incorrect User or Password”, MsgBoxStyle.Critical, “Access Denied!!!”)
Me.lbldisplay.Text = “Access Denied!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
End If
End If
End Sub
End Class
All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.