Index was outside the bounds of the array

Kennyqui 216 Reputation points
2022-05-14T00:18:57.15+00:00

How to fix this?
201856-image.png

Microsoft 365 and Office | Access | Development
Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 125.8K Reputation points
    2022-05-14T05:05:43.453+00:00

    Check a fix:

    . . .
    cmd.CommandText = "SELECT 1 FROM logininfo WHERE username = ? and StrComp([password], ?, 0) = 0"
    . . .
    If rd.Read
       MessageBox.Show("Logged In Successfully")
       Users.Show
    Else
       MessageBox.Show("Invalid username or password!")
    End
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.