Ver Mensaje Individual
  #8  
Antiguo 28-07-2003
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Reputación: 25
__cadetill Va por buen camino
Cita:
Posteado originalmente por fortran

While not eof do
sustituyelo por

Código:
modulodedatos.tablaserviciosclaveservicio.Eof
El with que haces, es sobre un TField, no sobre la tabla, de ahi el error ese, ya que tambien existe el EOF como funcion.

De todas maneras, desde mi punto de vista, el codigo que has puesto no es muy eficiente. Podrias mirar de sustituirlo por algo asi (que quizas no da tantas vueltas a la tabla)

Código:
var Q: TQuery;
begin
  Q := TQuery.Create(Self);
  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;
Responder Con Cita