This is part of my login form.
im trying to lock the account if there are to many failed login attempts. but im not sure if my sql statement is wrong or i my ExecuteNonQuery() is wrong.
heres part of my code. I should note that my "account_lock" column is a "Yes/No" column in access.
If FailAttemps = 6 Then
MessageBox.Show("6 Failed Login Attemps, This Account is Now Locked." _
+ "Please Contact an Admin to Unlock This Account.", "Failed Login", MessageBoxButtons.OK, MessageBoxIcon.Information)
Dim UpdateAccountLock As String = "UPDATE employee SET account_lock = '1' WHERE username = '" & UsernameTextBox.Text & "'"
DBconnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Login.accdb")
DBconnection.Open()
Dim LoginFailCommand As OleDbCommand = New OleDbCommand(UpdateAccountLock, DBconnection)
LoginFailCommand.ExecuteNonQuery()
Form1.Close()
Me.Close()
DBconnection.Close()
DBconnection.Dispose()