Ver Mensaje Individual
  #2  
Antiguo 22-10-2008
Avatar de enecumene
[enecumene] enecumene is offline
Miembro de Oro
 
Registrado: may 2006
Ubicación: Santo Domingo, Rep. Dom.
Posts: 3.040
Reputación: 22
enecumene Va por buen camino
Hola, no amigo no es necesario un TQuery por cada búsqueda, con uno basta ejemplo:

Código Delphi [-]
if ComboBox1.Text = 'Codigo' then
  begin
     Query1.Close;
     Query1.SQL.Clear;
     Query1.SQL.Text := 'select * from tabla where codigo = '12345'';
     Query1.Open;
  end;
if ComboBox1.Text = 'Nombre' then
  begin
     Query1.Close;
     Query1.SQL.Clear;
     Query1.SQL.Text := 'select * from tabla where Nombre = 'Pedro'';
     Query1.Open;
  end;
if ComboBox1.Text = 'Producto' then
  begin
     Query1.Close;
     Query1.SQL.Clear;
     Query1.SQL.Text := 'select * from tabla where producto = 'Jabon'';
     Query1.Open;
  end;

en este ejemplo estoy usando un sólo Query.

Saludos.
__________________

Mi BLOG - ¡Joder, leanse la guia de estilo!
Las Palabras son enanas, los ejemplos gigantes.
Responder Con Cita