I have an application that I want to use for keeping a track of stock. I have this code but it keeps giving the exception 'syntax error in update statement' I cannot for the life of me work out which bit is the error.
It 'should' update the field bottle (which is text) and quantity (which is number). Any ideas why it gives this message?
TIA
Code:
procedure TForm1.Button4Click(Sender: TObject); //update button
var
d: TDate;
DateToStr: string;
begin
If code.Text = '1234' then
ShowMessage('Now is ' + DateTimeToStr(Now));
begin
DateToStr := FormatDateTime ( 'dd/mm/yyyy', d );
with ADOQuery1 do
begin
Active:=False;
SQL.Clear;
SQL.Add('UPDATE tblStock SET bottle =' + QuotedStr(code.text) + ', quantity = quantity+5, WHERE reagname = "AST"');
ExecSQL;
end;
end;
end;
TIA