Troubles with DBF

This forum is meant for questions and discussions about the X# language and tools
User avatar
robert
Posts: 4261
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Troubles with DBF

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Troubles with DBF

Post 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
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Troubles with DBF

Post 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
Jamal
Posts: 315
Joined: Mon Jul 03, 2017 7:02 pm

Troubles with DBF

Post 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.
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Troubles with DBF

Post 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 :
--------------------
Attachments
anXsharp.zip
(657 Bytes) Downloaded 20 times
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Troubles with DBF

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Troubles with DBF

Post by Horst »

Hi Chris
In the zip the dbf files and the viaef, i hope the comments readable :-)
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Troubles with DBF

Post by Horst »

Ajj the zip rrr
Attachments
XS_Test.zip
(409.84 KiB) Downloaded 29 times
User avatar
Chris
Posts: 4584
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Troubles with DBF

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
g.bunzel@domonet.de
Posts: 97
Joined: Tue Mar 01, 2016 11:50 am
Location: Germany

Troubles with DBF

Post 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
Post Reply