Advance Login Form for System Security

PROGRAM DESCRIPTION

This program is an advance login security for your system. add this in your project then you have it 100% working. just dont forget to add the database. you may download the full project source code below for free!!!

SCREENSHOT

CODE
Module


Option Explicit

Public conn As ADODB.Connection

Public Sub connect()
Set conn = New ADODB.Connection
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\myDatabase.mdb;Persist Security Info=False"
End Sub

Sub main()
connect
frmLogin.Show
End Sub

frmLogin

Private Sub cmdCancel_Click()
End
End Sub

Private Sub cmdOK_Click()

Dim rs As New ADODB.Recordset

rs.Open "SELECT * FROM tblUser WHERE username = '" & txtUserName & "'", conn, adOpenStatic, adLockReadOnly
    If rs.RecordCount <> 0 Then
        If txtPassword = rs!password Then

            MsgBox "Username and Password Succesful!"
            'Remove msgbox above then call a form to be load if login is succesful!
         
        Else
            MsgBox "Invalid Password, try again!", , "Login"
        End If
    Else
        MsgBox "Invalid Login, try again!", , "Login"
 
    End If
    rs.Close
    Set rs = Nothing

End Sub
Related Posts Plugin for WordPress, Blogger...

CHATBOX

Translate

Download Installer

Filter Post Here...