Thursday, August 29, 2019

Three Attempts Login System in Visual Basic 6 and Microsoft Access

Here is a copy that is written by my business partner, a close friend and fellow software engineer Sir Larry Emol to ask the user to login the system after three attempts it will lock the user account. This program is written using Visual Basic 6 and Microsoft Access as our database.


I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com





Sample Program Output


Program Listing


Private Sub Command1_Click()
On Error Resume Next
Static count As Integer
 Set rstUserAcct = New ADODB.Recordset
    If rstUserAcct.State = 1 Then rstUserAcct.Close
    rstUserAcct.Open "Select * from tblInfo where Username = '" & Text1.Text & "'", MyConn, adOpenDynamic, adLockBatchOptimistic
    
    
    If Me.Text1.Text = "" Then
    MsgBox "Enter Username", vbInformation, "Username"
    Me.Text1.SetFocus
    Exit Sub
    End If
    
    If Me.Text2.Text = "" Then
    MsgBox "Enter Password", vbInformation, "Password"
    Me.Text2.SetFocus
    Exit Sub
    End If
    
    If rstUserAcct.RecordCount = 0 Then
    MsgBox "Username not found", vbInformation, "Username"
    Exit Sub
    End If
           
    If rstUserAcct.Fields!Locked = True Then
    MsgBox "Password is Lock", vbInformation, "Contact Administrator"
    Exit Sub
    End If
            
If rstUserAcct.Fields("Password") = Text2.Text Then
            
                Unload Me
                Mainform.Show
                
Else
MsgBox "Invalid Password!", vbExclamation, "Sample App"
count = count + 1
Me.Tag = count
            If Me.Tag = 1 Then
                Me.Label2.Caption = "2 Attempts"
            ElseIf Me.Tag = 2 Then
                Me.Label2.Caption = "1 Attempts"
            ElseIf Me.Tag = 3 Then
                rstUserAcct.Fields!Locked = True
                rstUserAcct.UpdateBatch
            End If
End If
End Sub




No comments:

Post a Comment