FUNCTION ATUAL_REG()
HB_GCALL( .F. )
WaitOn( "Espere, recogiendo informacion...", @oWait )
FWCONNECT lServer HOST cServer ;
USER cUser ;
PASSWORD cPassword ;
DATABASE cDBName
CheckConect()
cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"
cQry := aServer:Query( cMsg )
nnc := 1
WHILE .NOT. cQry:Eof()
SYSREFRESH()
SYSWAIT( 3.5 ) // Delay aqui.
HB_GCALL( .F. )
oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + Space( 40 ) )
cMsg := "SELECT * FROM personal_mov WHERE id = " + ClipValue2Sql( cQry:id )
aQry := lServer:Query( cMsg )
IF aQry:LastRec() > 0
oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + " ok..." + Space( 30 ) )
// SysRefresh()
cMsg := "update personal_mov set "
cMsg += "idasistencia = " + ClipValue2Sql( aQry:idasistencia )
cMsg += ",idempresa = " + ClipValue2Sql( aQry:idempresa )
cMsg += ",idfundo = " + ClipValue2Sql( aQry:idfundo )
cMsg += ",campana = " + ClipValue2Sql( aQry:campana )
cMsg += ",semana = " + ClipValue2Sql( aQry:semana )
cMsg += ",tipo = " + ClipValue2Sql( aQry:tipo )
cMsg += ",idpersonal = " + ClipValue2Sql( aQry:idpersonal )
cMsg += ",fecha = " + ClipValue2Sql( aQry:fecha )
cMsg += ",idparcela = " + ClipValue2Sql( aQry:idparcela )
cMsg += ",idlote = " + ClipValue2Sql( aQry:idlote )
cMsg += ",idlabor = " + ClipValue2Sql( aQry:idlabor ) + " "
cMsg += "WHERE id=" + ClipValue2Sql( aQry:id )
aServer:Execute( cMsg )
ENDIF
aQry:End() // ESTO ESTA CORRECTO?
cQry:Skip()
nnc++
ENDDO
HB_GCALL( .T. )
cQry:End()
lServer:End() // lSerVer := NIL ??
RETURN NIL
FUNCTION ATUAL_REG()
HB_GCALL( .F. )
WaitOn( "Espere, recogiendo informacion...", @oWait )
FWCONNECT lServer HOST cServer ;
USER cUser ;
PASSWORD cPassword ;
DATABASE cDBName
CheckConect()
cMsg := "SELECT * FROM personal_mov p WHERE fecha='2030-03-04'"// LIMIT 2000"
cQry := aServer:Query( cMsg )
nnc := 1
WHILE .NOT. cQry:Eof()
SYSREFRESH()
SYSWAIT( 0.5 ) // Delay aqui.
HB_GCALL( .F. ) // Puede tambien: HB_GCALL()
IF LASTKEY() = VK_ESCAPE
IF MsgNoYes( OemToAnsi( "Atención al usuario: " ) + CRLF + ;
+ CRLF + ;
OemToAnsi( "Escribiste <ESCAPE> " ) + CRLF + ;
OemToAnsi( "Tienes problemas " ) + CRLF + ;
OemToAnsi( "¿en la actualización? " ) + CRLF + ;
+ CRLF + ;
OemToAnsi( "¿Realmente quieres salir? " ) + CRLF + ;
OemToAnsi( "Escribe todo..." ) + CRLF + ;
+ CRLF + ;
OemToAnsi( "<S> Estoy continuando... " ) + CRLF + ;
OemToAnsi( "<N>o Continue(Salir) " ), ;
OemToAnsi( "¿Problemas con el programa?" ) ) = .F.
// comando...
RETURN( .F. )
ENDIF
ENDIF
oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + Space( 40 ) )
cMsg := "SELECT * FROM personal_mov WHERE id = " + ClipValue2Sql( cQry:id )
aQry := lServer:Query( cMsg )
IF aQry:LastRec() > 0
oWait:Say( 1, 3, "Espere, actualizando Reg.: " + AllTrim( Str( cQry:id ) ) + " -- " + AllTrim( Str( nnc ) ) + " ok..." + Space( 30 ) )
// SysRefresh()
cMsg := "update personal_mov set "
cMsg += "idasistencia = " + ClipValue2Sql( aQry:idasistencia )
cMsg += ",idempresa = " + ClipValue2Sql( aQry:idempresa )
cMsg += ",idfundo = " + ClipValue2Sql( aQry:idfundo )
cMsg += ",campana = " + ClipValue2Sql( aQry:campana )
cMsg += ",semana = " + ClipValue2Sql( aQry:semana )
cMsg += ",tipo = " + ClipValue2Sql( aQry:tipo )
cMsg += ",idpersonal = " + ClipValue2Sql( aQry:idpersonal )
cMsg += ",fecha = " + ClipValue2Sql( aQry:fecha )
cMsg += ",idparcela = " + ClipValue2Sql( aQry:idparcela )
cMsg += ",idlote = " + ClipValue2Sql( aQry:idlote )
cMsg += ",idlabor = " + ClipValue2Sql( aQry:idlabor ) + " "
cMsg += "WHERE id=" + ClipValue2Sql( aQry:id )
aServer:Execute( cMsg )
ENDIF
aQry:End() // ESTO ESTA CORRECTO?
cQry:Skip()
nnc++
ENDDO
HB_GCALL( .T. )
cQry:End()
lServer:End() // lSerVer := NIL ??
RETURN NIL
Var:=0
Do while ...
++Var
...
If mod(Var,20)=0
Sysrefresh()
Endif
Enddo
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 93 guests