' OK button Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=C:\Users\Jill\Desktop\saddbase\Sadsystem\Sadsystem\bin\Debug\tenant.mdb") Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM info WHERE TN_ID = '" & UsernameTextBox.Text & "' AND Password = '" & PasswordTextBox.Text & "' ", con) con.Open() Dim sdr As OleDbDataReader = cmd.ExecuteReader() ' If the record can be queried, Pass verification and open another form. If (sdr.Read() = True) Then MessageBox.Show("The user is valid!") Me.Hide() Else MessageBox.Show("Invalid Tenant ID or password!") End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)