Delphi ADO SQL Syntax Error

Posted by pr0wl on Stack Overflow See other posts from Stack Overflow or by pr0wl
Published on 2010-03-25T16:55:36Z Indexed on 2010/03/25 17:33 UTC
Read the original article Hit count: 595

Filed under:
|
|
|

Hello.

I am getting an Syntax Error when processing the following lines of code. Especially on the AQ_Query.Open;

procedure THauptfenster.Button1Click(Sender: TObject);
var
    option: TZahlerArray;
begin
    option := werZahlte;
    AQ_Query.Close;
  AQ_Query.SQL.Clear;
  AQ_Query.SQL.Add('USE wgwgwg;');
  AQ_Query.SQL.Add('INSERT INTO abrechnung ');
  AQ_Query.SQL.Add('(`datum`, `titel`, `betrag`, `waldemar`, `jonas`, `ali`, `ben`)');
  AQ_Query.SQL.Add(' VALUES ');
  AQ_Query.SQL.Add('(:datum, :essen, :betrag, :waldemar, :jonas, :ali, :ben);');
  AQ_Query.Parameters.ParamByName('datum').Value := DateToStr(mcDatum.Date);
  AQ_Query.Parameters.ParamByName('essen').Value := ledTitel.Text;
  AQ_Query.Parameters.ParamByName('betrag').Value := ledPreis.Text;
  AQ_Query.Parameters.ParamByName('waldemar').Value := option[0];
  AQ_Query.Parameters.ParamByName('jonas').Value := option[1];
  AQ_Query.Parameters.ParamByName('ali').Value := option[2];
  AQ_Query.Parameters.ParamByName('ben').Value := option[3];
  AQ_Query.Open;
end;

The error:

SQL Error

I am using MySQL Delphi 2010.

© Stack Overflow or respective owner

Related posts about sql

Related posts about syntax