Ver Mensaje Individual
  #7  
Antiguo 09-03-2019
JorgeDM JorgeDM is offline
Registrado
 
Registrado: mar 2019
Posts: 8
Reputación: 0
JorgeDM Va por buen camino
Casimiro, muchas gracias por cada apunte ya había probado los puntos que me dice pero se sigue pausando allí, este es un ejemplo mas completo

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;

  for cont := 1 to Query6.RecordCount 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 := Editano.Text;
    Table2.FieldByName('mes_mov').Value := mes;
    Table2.Post;
    Table2.Close;
     qconsr := nil;
    qconsr := TQuery.create(qconsr);
    qconsr.DatabaseName := Md_comun.BD_Tesoreria.DatabaseName;
    madr := '';
        madr := 'update pagos  set deter = ' + FloatToStr(v1) +
      ' where nrocredito = ' +
      Query6.FieldByName('nro_credito').AsString + ' and documento = ' +
      Query6.FieldByName('documento').AsString + ' and consecutivo = ' +
      Query6.FieldByName('consecutivo').AsString;
    with qconsr do
    begin
      Close;
      SQL.Clear;
      SQL.Add(madr);
      ExecSQL;
    end;
    Query6.Next;
  end;

como digo funciona bien hasta llegar al ultimo registro justo en ExecSQL muere, y me bloque al modulo
Código Delphi [-]
with qconsr do
    begin
      Close;
      SQL.Clear;
      SQL.Add(madr);
      ExecSQL;
    end;
Responder Con Cita