Ver Mensaje Individual
  #5  
Antiguo 28-05-2010
Avatar de Faust
Faust Faust is offline
Miembro
 
Registrado: abr 2006
Ubicación: México D.F.
Posts: 930
Reputación: 19
Faust Va por buen camino
Saludos, he estado viendo tu código y para recorrer tu tabla origen sería mejor hacer un while, te incluyo un ejemplo:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var cont:integer;
begin
cont:=0;
showmessage('iniciado');
with database2 do
  begin
    Close;
    Open;
  end;
with query2 do
  BEGIN
    close;
    SQL.Text:='select * from vw_movimientos';
    open;
    first;
    database1.Close;
    database1.Open;
    showmessage(IntToStr(RecordCount));
{    for cont:=0 to RecordCount -1 do
    begin
      query1.Close;
      query1.SQL.Text:='insert into vw_movimientos(fecha) values (''' +fields[0].AsString + ''') ';
      query1.ExecSQL;
      query1.Close;
      query2.Next;
    end;
}
    
    while not Eof do
    begin
      query1.Close;
      query1.SQL.Text:='insert into vw_movimientos(fecha) values (''' +fields[0].AsString + ''') ';
      query1.ExecSQL;
      query1.Close;
      Next
    end;
    
    database1.Close;
    close;
  end ;
 showmessage('finalizado');
end;

Y así no te limita ni el conteo... inténtalo y nos cuentas.
__________________
Herr Heins Faust
Responder Con Cita