I have problem with my small vb program, just started to learn VB this week.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As String
With record
s = "SELECT * FROM user1"
record.Open(s, data)
If TextBox1.Text = record.Fields(0).Value And TextBox2.Text = record.Fields(1).Value Then
MsgBox("OKKKK")
Else
MsgBox("WROOOOOOOOOOOONG!", MsgBoxStyle.Exclamation)
End If
End With
record.Close()
End Sub
The program seems to work but it queries only on row 1. Like if I have 2 columns (USERNAME and PASSWORD) with (row 1)ADMIN and ADMIN, (row 2)GUEST and GUEST.
It only displays the msgbox("OKKK") when I enter ADMIn and ADMIN while if I enter GUEST and GUEST, the msgbox("WRRoong!") is executed. How do I get it to work on both login information?