Private Sub cmdOK_Click()
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields(0) <> txtuser.Text Or Adodc1.Recordset.Fields(1) <> txtPassword.Text Then
MsgBox "Please verify login details", vbInformation + vbOKOnly, "Login Denied"
txtuser.SetFocus
txtuser.Text = ""
txtPassword.Text = ""
Else
Unload Me
Load Main
Main.Show
End If
Adodc1.Recordset.MoveNext
Loop
End Sub
I would appreciate it if someone looked at the code snippet above and told me if any changes need be made! This is the code I use for a login form that connects to a SQL SERVER 2005 DB! Now why isn't this working? It seems to ONLY fetch the data from the first row of the two columns, not the rows that follow?