Ver Mensaje Individual
  #15  
Antiguo 11-03-2019
JorgeDM JorgeDM is offline
Registrado
 
Registrado: mar 2019
Posts: 8
Reputación: 0
JorgeDM Va por buen camino
se bloquea la ejecución de un Query

Buenos días, ya había mandado esta inquietud en un hilo que no hice, y parece ser que lo quitarón , migre de XE2 donde utilizaba BDE, pase el modulo a delphi XE8 y cambie a FireDAC, estoy haciendo pruebas, el recorre el ciclo bien hasta el ultimo registro, cuando va a terminar el ciclo el ultimo registro se queda en
Código Delphi [-]
ExecSQL
del qrconsr, ya le hice unos cambios que me habían comentado en el anterior Hilo donde copie la inquietud pero sigue el error,
pero sigue pegándose en el ultimo registro. envió el código

Código Delphi [-]
 with Query6 do
  begin
    Query6.Close;
    Query6.Params[0].AsString := Edit_ano.Text;
    Query6.Params[1].AsString := mes;
    Query6.Open;
  end;

v1 := 0;

  while not Query6.Eof do
  begin
    v1 := Query6.FieldByName('reversion').AsInteger;
    Table2.Open;
    Table2.Insert;
    Table2.FieldByName('cuenta').Value := '139905';
    Table2.FieldByName('num_mov').Value := '138';
    Table2.FieldByName('tipo_mov').Value := 'DT';
    Table2.FieldByName('consec').Value := cons;
    Table2.FieldByName('ano_mov').Value := Edit_ano.Text;
    Table2.FieldByName('mes_mov').Value := mes;
    Table2.Post;
    Table2.Close;
     
qconsr := TFDQuery.create(nil);

    try
      qconsr.ConnectionName := Md_comun.BD_Tesoreria.ConnectionName;
      qconsr.SQL.Clear;
      qconsr.SQL.Add('UPDATE pago set deter = :P1 ');
      qconsr.SQL.Add('WHERE nrocredito = :P2 AND documento = :P3 ');
      qconsr.SQL.Add('AND consecutivo = :P4');
      qconsr.ParamByName('P1').AsFloat  := v1;
      qconsr.ParamByName('P2').AsString := Query6.FieldByName('nrocredito').AsString;
      qconsr.ParamByName('P3').AsString := Query6.FieldByName('documento').AsString;
      qconsr.ParamByName('P4').AsString := Query6.FieldByName('consecutivo').AsString;
      qconsr.ExecSQL;
    finally
      qconsr.Free;
    end;

    Query6.Next;
  end;
Responder Con Cita