Context
I added the option to modify the password and email address on my website. I have a microsoft Access Database. It has the columns "EmailAddress", "Password" and "Username" in the "Login" Table.
Code
'For testing purposes, lets say :
VB_PasswordTXT = "1000:8NHLJo5oIDugFdzscuMrNSKyoNTRa0kI:6NSlpqGYC4zU2BG6cfJaHaPgVRCDPCc2"
VB_UserNameTXT = "Test123"
VB_EmailTXT = "[email protected]"
Using thisConnection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""path""")
Using thisCommand As OleDbCommand = thisConnection.CreateCommand
' Open connection object
thisConnection.Open()
' Initialize SQL SELECT command to retrieve desired data
thisCommand.CommandText = "UPDATE Login SET EmailAddress = @EmailAddress, Password = @Password " & _
"WHERE Username = @Username"
thisCommand.Parameters.AddWithValue("@Username", VB_UserNameTXT)
thisCommand.Parameters.AddWithValue("@EmailAddress", VB_EmailTXT)
thisCommand.Parameters.AddWithValue("@Password", VB_PasswordTXT)
' Create a DataReader object based on previously defined command object
Dim thisReader As OleDbDataReader = thisCommand.ExecuteReader() 'Crashes here
If thisReader.Read() Then
End If
thisReader.Close()
thisConnection.Close()
End Using
End Using
Crash log
Syntax error in the UPDATE command. (Free translation from French)
Question
(As far as I know), the problem is coming from the UPDATE syntax. What is wrong in it?