I am opening a DBF as a binary file in VB.Net to determine the structure. I have to do it this way since using the Visual Foxpro OLEDB driver does not return the precision and scale of decimal fields. I am succesfully accomplishing my task with no problem. The problem I am having is this:
Byte 0 is the DBF file type.
Bytes 1-3 is the Last Update (yymmdd).
Bytes 4-7 of a DBF file is the Number of records in the file.
Bytes 8-9 is the Position of the first data record.
Bytes 10-11 is the Length of one data record, including the delete flag.
(This information comes from http://www.dbf2002.com/dbf-file-format.html)
The following is the first 32 bytes of my DBF file, separated by hyphens:
48-13-2-6-158-0-0-0-168-9-18-3-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1-3-0-0
The "48" (Hex 30) means Visual Foxpro
Bytes 1-3 say that the file was last updated on 2/6/2013.
Bytes 4-7 say that the file has 158 records.
All of these are correct.
Bytes 8-9 are 168 and 9, and Bytes 10-11 are 18 and 3.
The actual record size is 786 bytes. Since there is 68 fields, the position of the first data record should be (68x32+31) = 2207.
Is there some conversion I must do to convert 1689 to 2207 and 183 to 786?
I have tried dec to hex and vice versa.