Fórum Pesquisa #381137
11/07/2010
0
IBQ_pesq.SQL.add ('select * from transportadora t, regiao r');
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora and');
IBQ_pesq.SQL.Add ('r.uf like :pnome');
IBQ_pesq.ParamByName('pnome').AsString:='%'+edit1.text+'%';
IBQ_pesq.Open;
so que quando eu digito alguma coisa dentro da edit, ele me da o seguinte erro... Project Project.exe raised exception class EIBclienterror with message ' trying to store a string of lenght 3 into a field that can only contain 2'. Process stopped. Use Step or run to continue.
Sera que alguem poderia me ajudar a resolver esse erro ?? Desde ja agradeço
Leandro Santos
Curtir tópico
+ 0Posts
11/07/2010
Emerson Nascimento
Gostei + 0
12/07/2010
Leandro Santos
Gostei + 0
12/07/2010
Leandro Santos
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora and');
IBQ_pesq.SQL.Add ('r.uf = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:=edit1.text;
IBQ_pesq.Open;
Gostei + 0
12/07/2010
Wilson Junior
Espero ter colaborado.
Gostei + 0
12/07/2010
Carlos Mazzi
Gostei + 0
12/07/2010
Leandro Santos
Gostei + 0
12/07/2010
Marco Salles
Gostei + 0
12/07/2010
Marco Salles
Gostei + 0
12/07/2010
Emerson Nascimento
não é só isso! é necessário alterar o campo que será pesquisado.
IBQ_pesq.Close;
IBQ_pesq.SQL.Clear;
IBQ_pesq.SQL.add ('select * from transportadora t, regiao r');
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora');
if radiobutton2.checked then // radiobutton por nome
begin
IBQ_pesq.SQL.Add ('r.nome = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:='%'+edit1.text+'%';
end;
if radiobutton3.checked then // radiobutton por UF
begin
IBQ_pesq.SQL.Add ('r.uf = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:=edit1.text;
end;
IBQ_pesq.Open;
Gostei + 0
12/07/2010
Leandro Santos
não é só isso! é necessário alterar o campo que será pesquisado.
IBQ_pesq.Close;
IBQ_pesq.SQL.Clear;
IBQ_pesq.SQL.add ('select * from transportadora t, regiao r');
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora');
if radiobutton2.checked then // radiobutton por nome
begin
IBQ_pesq.SQL.Add ('r.nome = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:='%'+edit1.text+'%';
end;
if radiobutton3.checked then // radiobutton por UF
begin
IBQ_pesq.SQL.Add ('r.uf = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:=edit1.text;
end;
IBQ_pesq.Open;
Gostei + 0
12/07/2010
Leandro Santos
Gostei + 0
13/07/2010
Emerson Nascimento
que a rotina que te foi passada não deu certo?
Gostei + 0
13/07/2010
Leandro Santos
que a rotina que te foi passada não deu certo?
Gostei + 0
14/07/2010
Emerson Nascimento
IBQ_pesq.Close;
IBQ_pesq.SQL.Clear;
IBQ_pesq.SQL.add ('select * from transportadora t, regiao r');
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora');
if radiobutton2.checked then // radiobutton por nome
begin
IBQ_pesq.SQL.Add ('r.nome = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:='%'+edit1.text+'%';
end;
if radiobutton3.checked then // radiobutton por UF
begin
IBQ_pesq.SQL.Add ('r.uf = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:=copy(edit1.text,1,2); <-- veja se resolve
end;
IBQ_pesq.Open;
Gostei + 0
14/07/2010
Leandro Santos
IBQ_pesq.Close;
IBQ_pesq.SQL.Clear;
IBQ_pesq.SQL.add ('select * from transportadora t, regiao r');
IBQ_pesq.sql.Add('where t.cod_transportadora=r.cod_transportadora');
if radiobutton2.checked then // radiobutton por nome
begin
IBQ_pesq.SQL.Add ('r.nome = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:='%'+edit1.text+'%';
end;
if radiobutton3.checked then // radiobutton por UF
begin
IBQ_pesq.SQL.Add ('r.uf = :pnome');
IBQ_pesq.ParamByName('pnome').AsString:=copy(edit1.text,1,2); <-- veja se resolve
end;
IBQ_pesq.Open;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)