juniorcamilo escreveu:pelo DBU32 faz rapido!!! mas pelo .EXE demora muito !!
Pelo DBU é com ou sem índice, é pela rede ou local, é com usuários simultâneos ou não?
Isso tudo faz diferença, principalmente se a concorrência de bloqueios for grande.
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/
for nCont = 1000 to 1 step -1
append record nCont from &CLDADOS.ARQNOT&mArq..DBF for {||HRB_DOEVENTS(), .T. }
@ MaxRow(),00 say padc("Registro:" + alltrim(str(nCont)), 80)
next
#pragma BEGINDUMP
#include "windows.h"
#include "hbapi.h"
#include "olectl.h"
#include "time.h"
HB_FUNC( HRB_DOEVENTS )
{
MSG Msg;
while( PeekMessage( ( LPMSG ) &Msg, 0, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &Msg );
DispatchMessage( &Msg );
}
}
#pragma ENDDUMP
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
Pelo o que eu entendi você quer os últimos 1000 registros da tabela, então não seria isso que você postou?, considerando agora o código abaixo
append from APA02.DBF for RECNO() > LASTREC()-1000 .AND. {||HRB_DOEVENTS(), .T. }
►Harbour 3.x | Minigui xx-x | HwGui◄ Pense nas possibilidades abstraia as dificuldades. Não corrigir nossas falhas é o mesmo que cometer novos erros. A imaginação é mais importante que o conhecimento. (Albert Einstein)
SELECT origem
IF RecNo() ) < 1000
GOTOTOP
ELSE
GOTO ( LastRec() - 1000 )
ENDIF
DO WHILE ! Eof()
Destino->( RecAppend() )
FOR nCont = 1 TO FCount()
Destino->( FieldPut( nCont, origem->( FieldGet( nCont ) ) ) )
NEXT
SKIP
ENDDO
...
FUNCTION RecAppend()
// sua rotina de incluir
RETURN NIL
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2) "The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell" https://github.com/JoseQuintas/