update erro com sql
o que tem de errado aqui?
procedure TForm_cadartigos.BitBtn2Click(Sender: TObject);
begin
edit1.Text:=Query1Artigo.AsString;
edit2.Text:=query1preco.AsString;
try
with query1 do
begin
close;
sql.Clear;
sql.Add(´update artigo set artigo = edit1.Text, preco = edit2.Text´);
ExecSQL;
end;
except
MessageDLG(´NÃO FOI POSSIVEL EDITAR ESSE REGISTRO´, mtinformation, [mbok], 0);
end
end;
procedure TForm_cadartigos.BitBtn2Click(Sender: TObject);
begin
edit1.Text:=Query1Artigo.AsString;
edit2.Text:=query1preco.AsString;
try
with query1 do
begin
close;
sql.Clear;
sql.Add(´update artigo set artigo = edit1.Text, preco = edit2.Text´);
ExecSQL;
end;
except
MessageDLG(´NÃO FOI POSSIVEL EDITAR ESSE REGISTRO´, mtinformation, [mbok], 0);
end
end;
Anjomd
Curtidas 0
Respostas
Vinicius2k
28/09/2003
anjomd,
dessa forma sua query estah recebendo, literalmente, este texto ´ [color=blue:2b4b93ff5f]´update artigo set artigo = edit1.Text, preco = edit2.Text´[/color:2b4b93ff5f] ´...
tente :
o ideal nestes casos eh q vc utilize parametros, pois evita erros...
espero ter ajudado...
dessa forma sua query estah recebendo, literalmente, este texto ´ [color=blue:2b4b93ff5f]´update artigo set artigo = edit1.Text, preco = edit2.Text´[/color:2b4b93ff5f] ´...
tente :
sql.Add(´update artigo set artigo = ´ + edit1.Text + ´, preco = ´ + edit2.Text);
o ideal nestes casos eh q vc utilize parametros, pois evita erros...
espero ter ajudado...
GOSTEI 0