PESQUISA BD FIREBIRD COMPONENTES INTERBASE
MensagemEnviada: 27 Jul 2015 22:41 Assunto: PESQUISA BD FIREBIRD COMPONENTES INTERBASE Responder com Citação Editar/Remover esta mensagem Excluir esta mensagem
procedure TFrmPrincipal.Edit4Change(Sender: TObject);
begin
if not Dm.IBDataSet1.Active then
Dm.IBDataSet1.Open;
if RadioButton3.Checked = true then
begin
with Dm do
begin
IBDataSet1.Close;
IBDataSet1.SelectSQL.Clear;
IBDataSet1.SelectSQL.Add('SELECT * FROM RESERVISTA ');
IBDataSet1.SelectSQL.Add('WHERE upper( N_RES ) LIKE upper(' + '''' + '%' + Edit4.Text + '%' + '''' +')');
IBDataSet1.SelectSQL.Add('ORDER BY NOME');
IBDataSet1.Open;
end;
end;
end;
Tenho está consulta no meu sistema com bd firebird e componentes interbase, quando eu apago a escrita do edit4, só volta ao DBGRID os registros que contem o campo(N_RES) cadastrado, se algum registro que cadastrei e deixei este campo vazio os dados desta linha do DBGRID não ficam visíveis.
procedure TFrmPrincipal.Edit4Change(Sender: TObject);
begin
if not Dm.IBDataSet1.Active then
Dm.IBDataSet1.Open;
if RadioButton3.Checked = true then
begin
with Dm do
begin
IBDataSet1.Close;
IBDataSet1.SelectSQL.Clear;
IBDataSet1.SelectSQL.Add('SELECT * FROM RESERVISTA ');
IBDataSet1.SelectSQL.Add('WHERE upper( N_RES ) LIKE upper(' + '''' + '%' + Edit4.Text + '%' + '''' +')');
IBDataSet1.SelectSQL.Add('ORDER BY NOME');
IBDataSet1.Open;
end;
end;
end;
Tenho está consulta no meu sistema com bd firebird e componentes interbase, quando eu apago a escrita do edit4, só volta ao DBGRID os registros que contem o campo(N_RES) cadastrado, se algum registro que cadastrei e deixei este campo vazio os dados desta linha do DBGRID não ficam visíveis.
Paulo
Curtidas 0
Respostas
Joel Rodrigues
27/07/2015
Provavelmente esses registros estão com o campo N_RES nulo, por isso não estão aparecendo. Você precisa incluir os registros onde N_RES IS NULL, ou converter esses casos para um string vazio, assim eles entrarão no filtro.
GOSTEI 0