Re: File Size Discrepancies

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Lew,

compare HEADER() with the filesize of a newly created
empty DBF, which consists of the header only.

->create table, ?HEADER() then close it with use, before
checking the filesize.

Then add one record and check with HEADER()+1+RECSIZE()

->use the dbf, append blank and use to close before checking
the filesize.

They also could have decided to return 1 more as the result of
HEADER(), but then HEADER() would be wrong for a new DBF.
They could also have decided to add that 1 byte to the header
before the first record is added, but they didn't, although that
extra byte wouldn't even have hurt way back when the dbf format
was founded. but MS didn't invent this, even not Foxsoftware.

So the +1 is the byte between header and the first record, that
is only added to the dbf, when the first record is added.

DBF file size should be
HEADER(), if RECCOUNT()=0
HEADER()+1+RECCOUNT()*RECSIZE(), if RECCOUNT()>0

Bye, Olaf.
.



Relevant Pages

  • Re: Strange VFP 9 behavior
    ... But that isn't going to happen since VFP 9 is VFP Last as we all know. ... much better at DBF tables and indexes. ... that it's possible incorrect reccount in DBF header that the initial corruption for more serious ones? ... Validate record count when opening a table. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: repair corrupt free standing table
    ... Try FoxFix from Hallogram.Com. ... The header is variable length. ... can load the DBF, strip off the header, and save the results to a text ... file format is such a bullet-proof style. ...
    (microsoft.public.fox.vfp.dbc)
  • Re: Visual Foxpro Dateien per DTS importieren
    ... Wenn das dann immer noch nicht hilft, dann fehlt wahrscheinlich im DBF Header der Eintrag mit welcher Codepage die DBF "gefüllt" wurde. ... Wenn Du ein FoxPro zur Verfügung hast, und die DBF öffnest, dann frägt FoxPro nach der Codepage. ... Normalerweise sollte aus dem Header in der Datei der Zeichensatz ...
    (microsoft.public.de.sqlserver)
  • Re: Fehlermeldung : "keine Tabelle" Tabelle > 2 GByte
    ... und das hab ich eben auch nochmal geprüft. ... Erstellt man eine DBF, dann ist Header() exakt ... die DBF-Dateigröße, die Formel ...
    (microsoft.public.de.fox)
  • RE: Damaged DBFs
    ... Let me tell you what we were doing when a dbf got corrupted. ... Our tables were in Dos Foxpro. ... We use to open the tables in (mFoxplus) add a record in it and save it. ... I think you have to update the table header by opening it in low level. ...
    (microsoft.public.fox.helpwanted)