Update Problem in Delphi

procedure TForm1.Button2Click(Sender: TObject);
begin
Query1.Active:=False;
Query1.SQL.Add('UPDATE UYELER SET UyeAdi='''+Edit2.Text+''' WHERE UyeKodu='''+Edit1.Text+'''');
Query1.Open;
end;

end.

When i run this procedure it gives a problem:"Invalid use of Update"; Why??
and How can i update querry either?

Comments

  • From delphi.about.com: "Use TQuery.Open to execute a query that produces a result set; use TQuery.ExecSQL to execute queries that do not produce result sets."

    See this link: http://delphi.about.com/od/database/l/aa060199.htm

    hth, pritaeas

    : procedure TForm1.Button2Click(Sender: TObject);
    : begin
    : Query1.Active:=False;
    : Query1.SQL.Add('UPDATE UYELER SET UyeAdi='''+Edit2.Text+''' WHERE UyeKodu='''+Edit1.Text+'''');
    : Query1.Open;
    : end;
    :
    : end.
    :
    : When i run this procedure it gives a problem:"Invalid use of Update"; Why??
    : and How can i update querry either?
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion