0

I have this SQL statement however despite using INSERT INTO statements i don't understand why this statement isn't working. The error is 'Syntax error in INSERT INTO statement' And the statement is:

"INSERT INTO LoginInformation (Username, Password) VALUES ('" & HashedUsername 
 & "', '" & HashedPassword & "')"

Just wondering if anyone can see any obvious errors. Thanks for any help.

5
  • 3
    Learn to use parameters. That will probably fix the syntax error. Commented Feb 17, 2018 at 17:23
  • There’s no reason to be creating queries dynamically. Look up “parameterized queries”. Commented Feb 17, 2018 at 17:23
  • 3
    Also research the keywords and reserved words for the DB provider you are using (you didnt mention it). Very likely password is a reserved word. Please read How to Ask and take the TOUR Commented Feb 17, 2018 at 17:26
  • Thanks @Plutonix it was the keywords Commented Feb 17, 2018 at 17:30
  • Glad to help. Please read How to Ask and take the tour Commented Feb 17, 2018 at 17:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.