Problema em Query

Delphi

06/09/2003

Olá ...

Gente estou com um problema na ADOquery parametro , hora me diz que o parametro não existe hora List index out of bounds(0)...

select *
from Valoremol
where Ct_ValEmol =:consulta

O que está errado???Já criei o param, hora não , realmente está estranho se alguém souber algo, agradeço;Datatype preenchido....

Catharina....


Catharina

Catharina

Curtidas 0

Respostas

Edineidaniel

Edineidaniel

06/09/2003

Bom,

Andei fazendo uns testes e funcionou..

Eu coloquei..

em um button o seguinte código..

ADOquery1.SQL.Clear;
ADOquery1.sql.add(´select * from Valoremol´);
ADOquery1.sql.add(´where Ct_ValEmol =:consulta´);
ADOquery1.params[0].asInteger:=StrToIntEdit2.text);
ADOquery1.open;
ADOquery1.active:=true;

Epero ter ajudado..

t+

Edinei


GOSTEI 0
Vinicius2k

Vinicius2k

06/09/2003

Catharina,
tenta ´pegar´ o parâmetro pelo nome...
ADOQuery1.ParamByName(´consulta´).asInteger := SEU_VALOR;

estou supondo que o parâmetro seja do tipo inteiro (asInteger)...


GOSTEI 0
Vander Batista

Vander Batista

06/09/2003

Catharina


Faça o seguinte
Select * FROM Val_Remol
Where Val_Remol = :Consulta (separe o igual dos dois pontos conforme ao lado).


Vander Batista


GOSTEI 0
Catharina

Catharina

06/09/2003

Olá..

obrigada por terem respondido, a dica de vcs funcionaram...

Catharina.


GOSTEI 0
POSTAR