Ver Mensaje Individual
  #10  
Antiguo 04-08-2008
Avatar de Garry
Garry Garry is offline
Miembro
 
Registrado: nov 2007
Posts: 60
Reputación: 17
Garry Va por buen camino
También, aunque no lo he examinado detenidamente, veo que esto falla:
[quote=coso;298671]
Código Delphi [-]
Query2.Active := false;
Query2.sql.text := 'select * from tablas where id = -1 and' 
for i := 0 to DBGrid1.SelectedRows.Count do
Query2.sql.text := ' id = ' + DBGrid1.SelectedRows.Items[i] + ' and'; 
Query2.Active := true;

... habiendo que eliminar un AND sobrante:
Código Delphi [-]
Query2.Active := false;
Query2.sql.text := 'select * from tablas where id = -1' 
for i := 0 to DBGrid1.SelectedRows.Count do
Query2.sql.text :=  ' and id = ' + DBGrid1.SelectedRows.Items[i]; 
Query2.Active := true;


No he examinado más. Saludos...
Responder Con Cita