Ver Mensaje Individual
  #15  
Antiguo 01-08-2003
fortran fortran is offline
Miembro
 
Registrado: may 2003
Ubicación: Asturias
Posts: 63
Reputación: 22
fortran Va por buen camino
Hola de nuevo Cadetill:

He tardado en responder porque he "pescado" un gripazo que me ha tenido en cama 2 días.

La solución que me propusiste funcionó a la perfección, solamente le añadí al principio del procedimiento una línea para borrar el memo1 antes de iniciar.

Por si a alguien le puede servir dejo aquí el código final.

Código:
Procedure RellenarDatosCliente;

var
Q: TQuery;
begin
with formularioprincipal do
Begin
  memo1.Lines.clear;
  Q := TQuery.create(Application);
  Q.DatabaseName := modulodedatos.TablaServicios.DatabaseName;
  Q.SQL.Text := 'select nombreservicio from TablaServicios where claveservicio = :valor';
  try
    // primero
    Q.ParamByName('valor').Value := modulodedatos.tablavisitasserviciorealizado1.value;
    Q.Open;
    if not Q.Fields[0].IsNull then Memo1.Lines.Add(Q.Fields[0].AsString);
    // segundo
    Q.Close;
    Q.ParamByName('valor').Value := modulodedatos.tablavisitasserviciorealizado2.value;
    Q.Open;
    if not Q.Fields[0].IsNull then Memo1.Lines.Add(Q.Fields[0].AsString);
    // tercero
    Q.Close;
    Q.ParamByName('valor').Value := modulodedatos.tablavisitasserviciorealizado3.value;
    Q.Open;
    if not Q.Fields[0].IsNull then Memo1.Lines.Add(Q.Fields[0].AsString);
    // ........
  finally
    FreeAndNil(Q);
  end;
End;
end;


Pues muchas gracias Cadetill, me has sido de gran ayuda.
__________________
- ¿Y cuando dejaré de aprender maestro?.

- El día que te mueras pequeño saltamontes.
Responder Con Cita