Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deciphering table header bytes 4-7
Message
From
19/11/2008 14:27:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01362880
Message ID:
01362904
Views:
7
The byte count is zero based, so the first byte is byte no. 0. I also found this link http://www.clicketyclick.dk/databases/xbase/format/dbf.html#DBF_STRUCT

>Thanks!!!!
>
>I knew it had to be something like that. However even had I gone in that direction I still would have been wrong. Because it looks from the MS code that they're working with bytes 5-8 not 4-7 (as specified in the VFP documentation).
>
>Am I reading the documetation or the code wrong?
>
>Hugh
>
>
>Help File - VFP Table File Structure
>Byte offset
>47        Number of records in file
>
>
>
>      lnHeaderByte8 = CHR(INT(lnCalcRecords / (256^3)))
>      lnHeaderByte7 = CHR(INT(lnCalcRecords / (256^2)))
>
>      lnHeaderByte6 = CHR(INT(lnCalcRecords / 256) - ;
>         IIF(lnCalcRecords / 256 > 256, ;
>             (INT(INT(lnCalcRecords / 256) / 256) * 256), ;
>             0))
>
>      lnHeaderByte5 = CHR(MOD(lnCalcRecords,256))
>
>
>
>
>>Check http://support.microsoft.com/kb/263902
>>
>>>Hi kids!
>>>
>>>I'm trying to figure out how to decipher table header bytes 4-7 (which according to the VFP help file) contains the number of records in the table file.
>>>
>>>Here's some data points:
>>>
>>>
>>>records      byte 4  5  6  7 
>>>-----------------------------
>>>      3           6- 3- 0- 0
>>>     40          22-40- 0- 0
>>>     18          11-18- 0- 0
>>> 217397          18-53-81- 3
>>>
>>>
>>>Here's the code I used:
>>>
>>>m.lcMyDBFFile = FILETOSTR("c:\whatever.dbf")
>>>
>>>m.lcString = TRANSFORM(ASC(SUBSTR(m.lcMyDBFFile,4,1))) + '-' ;
>>>				+ TRANSFORM(ASC(SUBSTR(m.lcMyDBFFile,5,1))) + '-' ;
>>>				+ TRANSFORM(ASC(SUBSTR(m.lcMyDBFFile,6,1))) + '-' ;
>>>				+ TRANSFORM(ASC(SUBSTR(m.lcMyDBFFile,7,1)))
>>>_cliptext = m.lcString
>>>
>>>
>>>Got any ideas??
>>>
>>>Hugh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform