30 Ago 2019 22:19
03 Set 2019 15:13
04 Set 2019 11:03
JoséQuintas escreveu:Faltou dizer:
NUNCA USEI COMMIT, nem dbcommit(), apenas SKIP 0 antes do UNLOCK.
Não tive problema nem com Visual Basic 6 acessando simultâneo.
SIXCDX no Clipper 5.2, SIXCDX no início de uso do Harbour, DBFCDX depois.
04 Set 2019 13:42
Fernando queiroz escreveu:Quintas como você faz a limpeza dos registros deletados no DBF?? ( ainda uso o pack)
04 Set 2019 19:38
04 Set 2019 22:57
Ranier escreveu:dbSkip(0)"A dbSkip( 0 ) will flush and refresh the internal database buffer and make any changes made to the record visible without moving the record pointer in either direction."
make any changes made to the record visible
05 Set 2019 10:54
05 Set 2019 13:43
dbCommit() causes all updates to the current work area to be written to disk. All updated database and index buffers are written to DOS and a DOS COMMIT request is issued for the database (.dbf) file and any index files associated with the work area.
05 Set 2019 14:10
05 Set 2019 14:31
JoséQuintas escreveu:TODOS concordam que o manual está errado, porque somente UNLOCK causa problemas.
05 Set 2019 14:55
05 Set 2019 15:41
05 Set 2019 19:56
09 Set 2019 13:44
Itamar M. Lins Jr. escreveu:Se não me falha a memória já li alhures o Przmek dizendo que skip(0) não faz o que o commit faz. Vou ver se acho isso.
FUNCTION RecUnlock()
SKIP 0
UNLOCK
RETURN NIL
09 Set 2019 14:19
#include "inkey.ch"
PROCEDURE Main
LOCAL mNome, GetList := {}, mSalva
SetMode(40,100)
CLS
IF ! File( "test.dbf" )
dbCreate( "test.dbf", { { "NOME", "C", 30, 0 } } )
ENDIF
USE test SHARED
IF Eof()
APPEND BLANK
REPLACE field->NOME WITH "1111111111"
APPEND BLANK
REPLACE field->NOME WITH "2222222222"
ENDIF
GOTO TOP
DO WHILE .T.
mNome := test->Nome
mSalva := " "
@ 2, 1 SAY "Nome:" GET mNome
@ 3, 1 GET mSalva PICTURE "!"
@ Row(), Col() + 2 SAY "(C=Commit, S=Skip 0, U=Unlock, N=Nenhum)"
READ
IF LastKey() == K_ESC
EXIT
ENDIF
IF mSalva $ "CSUN"
RLock()
REPLACE NOME WITH mNome
DO CASE
CASE mSalva == "C"; COMMIT; @ 5, 5 SAY "COMMIT"
CASE mSalva == "S"; SKIP 0; @ 5, 5 SAY "SKIP 0"
CASE mSalva == "U"; UNLOCK; @ 5, 5 SAY "UNLOCK"
OTHERWISE ; @ 5, 5 SAY " "
ENDCASE
ENDIF
SKIP 0
ENDDO
CLOSE DATABASES
RETURN
RLOCK()
SKIP 0