Hi guys, Im seeking help here. Been trying but yet i cant figure out what is wrong with my code here.
Public Class Login
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim connStr As String = _
Dim conn As New OleDbConnection(connStr)
Dim comm As New OleDbCommand("Select StaffID,Password from Staff where StaffID = " & tbxUsername.Text & " " & _
" and password = " & tbxPassword.Text & " ", conn)
Dim da As New OleDbDataAdapter(comm)
Dim ds As New DataSet()
da.Fill(ds, "StaffID", "Staff")
Dim reader As OleDbDataReader = comm.ExecuteReader
If Not reader.Read() Then
MessageBox.Show("Please enter your username & password again.", "Incorrect Username or Password", MessageBoxButtons.RetryCancel, _
Dim f As New LoanReturn
I have a access database that includes the StaffID and Password. My idea is to get this login form works with the database, meaning the StaffID and Password the user enters should be the same as in the database. When the StaffID and Password are entered correctly, it will get to another form.
I really appreciate if someone able to give me a helping hand. Im a newbie and still doing my best to master this vb