fbpx

DBFs wanted

More
1 week 1 day ago #1 by Karl-Heinz
DBFs wanted was created by Karl-Heinz
Guys,

I'm interested in the content of various DBF headers. Can someone give me a xBase++, Harbour and Visual Foxpro created dbf ? A single field - e.g. N, 5, 0 - without any content is enough.
,
TIA
Karl-Heinz

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #2 by wriedmann
Replied by wriedmann on topic DBFs wanted
Hi Karl-Heinz,

IMHO FoxPro has different headers, and they depend on the version.
And they have different fieldtypes that the Clipper/VO world does not recognize.

I don't have samples anymore, but to read VFP databases I could not use the DBFCDX RDD, but had to use a self written binary reader.
I have attached this code here (really old - I have dismissed it inthe year 2005)

File Attachment:

File Name: FoxProDBF-Code.zip
File Size:3 KB


Wolfgang
Attachments:

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #3 by Karl-Heinz
Replied by Karl-Heinz on topic DBFs wanted
Thanks Wolfgang,

to be more specific: i´m interested in the second byte of the headers, the place where the year of the last update is stored. In your code from 2005 you read the date:

ConDate( Asc( SubStr3( cBuffer, 2, 1 ) ), Asc( SubStr3( cBuffer, 3, 1 ) ), Asc( SubStr3( cBuffer, 4, 1 ) ) )

so i guess the second byte content of the VFP DBF was at this time 0x05.

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #4 by wriedmann
Replied by wriedmann on topic DBFs wanted
Hi Karl-Heinz,

AFAIK none of the DBF engines broke the DBF format of using only a 3 byte date.

Please see here: en.wikipedia.org/wiki/.dbf

My code was wrong here, I think.
DBase specifies this: www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm

So I had to add 1900 to the year value (what I didn't made).

Wolfgang

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #5 by Karl-Heinz
Replied by Karl-Heinz on topic DBFs wanted
Hi Wolfgang,

If you use SetEpoch() there´s no reason to add manually 100. My assumption was of course, that you have set SetEpoch () correctly before you executed the code.

DBase specifies this: www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm

I know this site ...

This here gives a much better explanation:
harbour.github.io/the-oasis/clipy2k.htm
[The .DBF header problem.] and the link to Greg Holmes


give it try with VO:

setcentury ( true )

setEpoch ( 1710 ) // yes, 1710 :-)
? condate ( 18 , 12 , 4 ) // 04.12.1718

setEpoch ( 1918 )
? condate ( 18 , 12 , 4 ) // 04.12.1918

setEpoch ( 1918 + 1 )
? condate ( 18 , 12 , 4 ) // 04.12.2018

The reason why i´ve started this thread: I only want to know/see how Harbour, xBase++ or VFP store e.g. the current year ( 2018 ) in the second byte. Is it 18 ( 0x12 ) as VO and even foxpro 2.0 does, or not.

BTW. VOs default SetEpoch() setting is 1910 ... time to move it ;-)

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

More
1 week 7 hours ago #6 by NEE4NEE
Attachments:

Please Log in or Create an account to join the conversation.

More
1 week 4 hours ago #7 by Karl-Heinz
Replied by Karl-Heinz on topic DBFs wanted
Many thanks !

as expected, the value of the second byte is "0x12"

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.