Ver Mensaje Individual
  #5  
Antiguo 17-12-2010
warrior79 warrior79 is offline
Registrado
 
Registrado: jun 2010
Posts: 8
Reputación: 0
warrior79 Va por buen camino
ok cuando lo corry me salian unos errors en la variable Strname porque no estaba declarada pero se lo agregue y me quedo asi
Código Delphi [-]
procedure Tfrminfo.BitBtn1Click(Sender: TObject);
Var
    i:integer;
    StrSQL:string;
    StrNames:string;
    StrName:string
begin
    // Preparamos la sentencia
    StrSQL := 'SELECT * FROM EMPLEADOS WHERE Nombre IN (%s)';
 // recorremos el memo con todos los nombres
    for i := 0 to (Memo1.Lines.Count - 1) do begin
        // le añadimos la coma si hace falta
        if (i > 0) then begin
            StrName := StrNames + ',';
        end;
        // nombre
        StrName := StrNames + QuotedStr(Memo1.Lines[i]);
    end;
    StrSQL := Format(StrSQL,[StrNames]);
end;

y ya no me salio error
Pero no me salio nada en mi DBGRID
como mando el resultado del query al DBGRID

gracias
Responder Con Cita