Page 1 of 1

delete selected record in tViewlist with mysql

Posted: 25.08.2014, 19:43
by drama22
iam trying to delete selected item from TListview and from mysql i do somthing like this

Code: Select all

procedure Tusersitngs.btnRemoveClick(Sender: TObject);
begin
delquery.Active := True;
delquery.Close;
delquery.SQL.Clear;
delquery.SQL.Text := 'delete from store where imit := Tlistview.item.selected';
delquery.ExecSQL;
end;
but i got sql is emty any idea ?

Re: delete selected record in tViewlist with mysql

Posted: 07.09.2014, 11:22
by EgonHugeist
but i got sql is emty any idea ?
Yes. Please look to your SQL.Text assembling again. Don't you think:

Code: Select all

delquery.SQL.Text := 'delete from store where imit := 'Tlistview.item.selected;
would be right? :mrgreen:

Re: delete selected record in tViewlist with mysql

Posted: 08.09.2014, 15:27
by drama22
yes thank you i found the problem its

Code: Select all

:=
and i have to add parambyname Thank you.