Porque está errado
20/03/2003
0
Fiz uma rotina assim:
with query1 do begin
close;
sql.clear;
sql.add(´update tabela set flag = ´S´ where nome =:nome´);
parambyname(´nome´).asstring:=dblookupcombobox1.text;
execsql;
close;
sql.clear;
sql.add(´select * from tabela´);
open;
end;
A msg e esta:
Unknown Column(nome).
Porque? nome é um campo válido.
with query1 do begin
close;
sql.clear;
sql.add(´update tabela set flag = ´S´ where nome =:nome´);
parambyname(´nome´).asstring:=dblookupcombobox1.text;
execsql;
close;
sql.clear;
sql.add(´select * from tabela´);
open;
end;
A msg e esta:
Unknown Column(nome).
Porque? nome é um campo válido.
Paulo
Curtir tópico
+ 0
Responder
Posts
20/03/2003
Adilsond
with query1 do
begin
if Active then
Close;
SQL.Clear;
SQL.Add(´update tabela´);
SQL.Add(´ set flag = ´ + QuotedStr(´S´));
SQL.Add(´where nome = :nome´);
ParamByName(´nome´).AsString := dblookupcombobox1.Text;
ExecSQL;
SQL.Clear;
SQL.Add(´select * from tabela´);
Open;
end;
ou
with query1 do
begin
if Active then
Close;
SQL.Clear;
SQL.Add(´update tabela´);
SQL.Add(´ set flag = ´ + QuotedStr(´S´));
SQL.Add(´where nome = ´ + QuotedStr(DbLookupCombobox1.Text));
ExecSQL;
SQL.Clear;
SQL.Add(´select * from tabela´);
Open;
end;
begin
if Active then
Close;
SQL.Clear;
SQL.Add(´update tabela´);
SQL.Add(´ set flag = ´ + QuotedStr(´S´));
SQL.Add(´where nome = :nome´);
ParamByName(´nome´).AsString := dblookupcombobox1.Text;
ExecSQL;
SQL.Clear;
SQL.Add(´select * from tabela´);
Open;
end;
ou
with query1 do
begin
if Active then
Close;
SQL.Clear;
SQL.Add(´update tabela´);
SQL.Add(´ set flag = ´ + QuotedStr(´S´));
SQL.Add(´where nome = ´ + QuotedStr(DbLookupCombobox1.Text));
ExecSQL;
SQL.Clear;
SQL.Add(´select * from tabela´);
Open;
end;
Responder
20/03/2003
Einstein
Fiz uma rotina assim:
with query1 do begin
close;
sql.clear;
sql.add(´update tabela set flag = ´+chr(39)+´S´+chr(39))
sql.add(´Where Nome=´+chr(39)+dblookupcombobox1.Text+chr(39)); assim vc não precisa mas de Parametros Trabalha só com SQL;
execsql;
close;
sql.clear;
sql.add(´select * from tabela´);
open;
end;
A msg e esta:
Unknown Column(nome). // vc não definiu o tipo do Parametro
Porque? nome é um campo válido.
with query1 do begin
close;
sql.clear;
sql.add(´update tabela set flag = ´+chr(39)+´S´+chr(39))
sql.add(´Where Nome=´+chr(39)+dblookupcombobox1.Text+chr(39)); assim vc não precisa mas de Parametros Trabalha só com SQL;
execsql;
close;
sql.clear;
sql.add(´select * from tabela´);
open;
end;
A msg e esta:
Unknown Column(nome). // vc não definiu o tipo do Parametro
Porque? nome é um campo válido.
Responder
Clique aqui para fazer login e interagir na Comunidade :)