xsharp.eu • Troubles with DBF - Page 3
Page 3 of 4

Troubles with DBF

Posted: Wed Jan 26, 2022 12:02 pm
by robert
Karl-Heinz wrote:G
VO: 460.800 Bytes
X#: 460.288 Bytes
This is because VO rounds the size to 1K pages. If you inspect the last 512 bytes of the VO CDX then you'll see that this is empty (or could contain garbage, I am not sure).

Robert

Troubles with DBF

Posted: Wed Jan 26, 2022 12:45 pm
by Karl-Heinz
Robert

the first bytes of the last 512 bytes seem to contain garbage, followed by 0s - but the last 4 bytes are "5A 45 41 4C" -> "ZEAL". This is the name of the last person in the created order. The same byte order exists before the last 512 bytes start.

Karl-Heinz

Troubles with DBF

Posted: Wed Jan 26, 2022 1:17 pm
by Karl-Heinz
Robert,

Aarggh - what I wrote before refers to the X# CDX ... Looking at the VO CDX shows that the last 512 Bytes contain 0s

Karl-Heinz

Troubles with DBF

Posted: Wed Jan 26, 2022 2:38 pm
by Jamal
Karl,

I have better luck with MP4 files.

Jamal
Karl-Heinz wrote:Mmmh, it seems the forum software doesn´t like the GIF extension, because both files have now the PNG extension ?

anyway, i´ ll put the animated GIFs in a zip and try it again.

Troubles with DBF

Posted: Tue Feb 01, 2022 5:24 pm
by Horst
Hallo
As i said, i was goinig back to X#2.6a. The troubles with the ftp files comes also.

Then i saw, 2.10 is now online. I installed this version hopefull it will fix my problem.
But it was more worst. On click and the PRG destroyed the ftp.

The method - Kontroll_Ein_Insert makes a new Tmp File. and -- Kontroll_Edit_Browser cant read the file. The Tmp file is in the zip.

METHOD Kontroll_Ein_Insert (nRecno AS DWORD) AS VOID PASCAL
LOCAL odbServer AS _cryptServer
LOCAL odbServerNew AS _cryptServer
LOCAL cFile AS STRING
LOCAL cTempfile AS STRING
LOCAL nRecno2 AS DWORD

nRecno2 := nRecno -1

SELF:odbKontroll:GoTo (SELF:gdKontroll)

IF SELF:gdKontroll = 0
SELF:odbKontroll:RecycleAppend (5)
// SELF:odbKontroll:Append ()
SELF:odbKontroll:FIELDPUT (#TempFile ,CreateKontrollTemp (SELF:gcPathUserTmp, SELF:gcUserId))
SELF:odbKontroll:FIELDPUT (#Dat_Edit ,Today ())
SELF:odbKontroll:FIELDPUT (#Nachname , "Kontroll : "+NTrim (SELF:odbKontroll:RECNO))
SELF:odbKontroll:Unlock ()
SELF:gdKontroll := SELF:odbKontroll:RecNo
//SetParamValue ("F_NACHNAME",SELF:odbKontroll:FIELDGET (#Nachname))
ENDIF

IF SELF:gdKontroll > 0 // Check bei MultiUser
IF SELF:odbKontroll:FIELDGET (#Entfernt) != "11"
cFile := WorkDir () + SELF:gcPathUserTmp + AllTrim (SELF:odbKontroll:FIELDGET (#TempFile))
SELF:odbKontroll:LockCurrentRecord ()
SELF:odbKontroll:FIELDPUT (#TempFile, CreateKontrollTemp (SELF:gcPathUserTmp, SELF:gcUserId))
SELF:odbKontroll:Unlock ()
cTempfile := WorkDir () + SELF:gcPathUserTmp + AllTrim (SELF:odbKontroll:FIELDGET (#TempFile))

oDbServer := _CryptServer { cFile, DBSHARED, IIF (TRUE, DBREADWRITE, DBREADONLY) }
oDbServer:concurrencyControl := ccNone
odbServer:SetOrder (0)

oDbServerNew := _CryptServer { cTempfile, DBSHARED, IIF (TRUE, DBREADWRITE, DBREADONLY) }
oDbServerNew:concurrencyControl := ccNone
odbServerNew:SetOrder (0)
odbServerNew:AppendDB (odbServer, , {|| RecNo () < nRecno})
odbServerNew:Append ()
odbServerNew:AppendDB (odbServer, , {|| RecNo () > nRecno2})
odbServer:Close ()
odbServerNew:Close ()

SELF:odbKontroll:LockCurrentRecord ()
SELF:odbKontroll:FIELDPUT (#DateEdit, DToC (Today())+NTrim (Seconds()))
SELF:odbKontroll:Unlock ()

IF ! FErase (String2Psz (cFile))
SELF:WriteCgiLog ("altes File konnte nicht gelöscht werden "+cFile )
SELF:Err_DeleteFile (cFile, "Kontroll_Ein_Insert")
ENDIF

IF ! FErase (String2Psz (StrTran (Upper(cFile),"DBF","FPT")))
SELF:WriteCgiLog ("altes File konnte nicht gelöscht werden "+String2Psz (StrTran (Upper(cFile),"DBF","FPT")))
SELF:Err_DeleteFile (String2Psz (StrTran (Upper(cFile),"DBF","FPT")), "Kontroll_Ein_Insert")
ENDIF

ENDIF
ENDIF

SELF:Kontroll_Edit_Browser ()

RETURN NIL

------Error---
2.10.0.3
01.02.2022 17:39:25
Application: C:XIDEProjectsSwissbaseBinDebugWebServer.exe

Error message:
--------------
Beschreibung : Beschädigung gefunden (Lese-Fehler)
Subsystem : DBFCDX
Generischer Code : EG_CORRUPTION Beschädigung gefunden
Untercode : 1110 Lese-Fehler
FuncSym : FIELDGET
Schwere : ES_ERROR
Kann Default : True
Kann erneut versuchen : False
Kann ersetzen : False
Datei : C:XIDEProjectsSwissbaseBinDebugsbs_elektroUser03106tempk3106635654601022022.dbf
Aufrufreihenfolge :
FPTMEMO:_GETBLOCK (Line: 0)
FPTMEMO:GETRAWVALUEWITHHEADER (Line: 0)
DBFFPT:GETVALUE (Line: 0)
DBFCDX:GETVALUE (Line: 0)
COREDB:DO (Line: 0)
COREDB:FIELDGET (Line: 0)
VODB:FIELDGET (Line: 0)
DBSERVER:FIELDGET (Line: 0)
ELEKTROKONTROLLBERICHTCONTEXT:KONTROLL_EDIT_BROWSER (Line: 580)
ELEKTROKONTROLLBERICHTCONTEXT:KONTROLL_EIN_INSERT (Line: 1296)
ELEKTROKONTROLLBERICHTCONTEXT:DISPATCH (Line: 188)
STARTELEKTROKONTROLLBERICHT (Line: 32)
HTTPSERVER:RESPONSE (Line: 308)
HTTPSERVER:PROCESSOR (Line: 94)
THREADHELPER:THREADSTART_CONTEXT (Line: 0)
EXECUTIONCONTEXT:RUNINTERNAL (Line: 0)
EXECUTIONCONTEXT:RUN (Line: 0)
EXECUTIONCONTEXT:RUN (Line: 0)
THREADHELPER:THREADSTART (Line: 0)


Error Object created:
--------------------
SubSystem :DBFCDX
SubCode :1110
GenCode :Beschädigung gefunden
OsCode :0
ArgType :NIL
FuncPtr :0
ArgNum :0
FuncSym :FIELDGET
Severity :2
CanDefault :.T.
CanRetry :.F.
CanSubstitute :.F.
Operation :
Description :Beschädigung gefunden (Lese-Fehler)
FileName :C:XIDEProjectsSwissbaseBinDebugsbs_elektroUser03106tempk3106635654601022022.dbf
Tries :0
FileHandle :0
SubCodeText :Lese-Fehler
Arg :
ArgTypeReq :NIL
MaxSize :0
SubstituteType :NIL
CallFuncSym :
--------------------

Troubles with DBF

Posted: Tue Feb 01, 2022 9:37 pm
by Chris
Hi Horst,

Maybe Robert will be able to find the problem by looking at the dbf/fpt alone. But this is not gonna be easy, so could you please also prepare a small standalone (compilable) sample that reproduces this problem?

Troubles with DBF

Posted: Wed Feb 02, 2022 9:02 am
by Horst
Hi Chris
In the zip the dbf files and the viaef, i hope the comments readable :-)

Troubles with DBF

Posted: Wed Feb 02, 2022 9:02 am
by Horst
Ajj the zip rrr

Troubles with DBF

Posted: Wed Feb 02, 2022 10:36 am
by Chris
Hi Horst,

Thanks, I see the problem, but only happens with the existing temp dbf/fpt files, if I create new ones, then it works fine. Not sure yet if it's a problem in the files themselves or in the X# RDD, but how where those files created? Where they created by a VO, X# or other app?

Troubles with DBF

Posted: Wed Feb 02, 2022 10:46 am
by g.bunzel@domonet.de
Horst,

with ConcurrencyControl := ccNone you do your own locking.
There is no Commit() before unlocking.

I think, that should be:
SELF:odbKontroll:LockCurrentRecord ()
SELF:odbKontroll:FIELDPUT (#DateEdit, DToC (Today())+NTrim (Seconds()))
SELF:odbKontroll:Commit ()
SELF:odbKontroll:Unlock ()

Maybe this helps.

Gerhard