Glen Morse
Glen Morse

Reputation: 2593

Syntax error db

This code:

Adoquery1.close;
Adoquery1.SQL.Clear;
sql := 'INSERT INTO Keywords (Keyword_Text) VALUE ( :keys )';
Adoquery1.SQL.Add(sql);
ADOQuery1.Parameters.ParamByName('keys').Value:= Lowercasek;
ADOQuery1.ExecSQL;

Keeps giving me

syntax error INSERT INTO

Debugging shows me that the value of keys is correct ("best"), the db name is correct ("Keywords") and the field is correct ("Keyword_Text").

Sql reads = 'INSERT INTO Keywords (Keyword_Text) VALUE ( :keys )'

See any reason why I get this error?

Upvotes: 2

Views: 81

Answers (1)

Bohemian
Bohemian

Reputation: 425288

The keyword is VALUES (not VALUE). Try this:

sql := 'INSERT INTO Keywords (Keyword_Text) VALUES ( :keys )';

Upvotes: 2

Related Questions