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
DBFs wanted
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) Wolfgang
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) Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
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
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
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: https://en.wikipedia.org/wiki/.dbf
My code was wrong here, I think.
DBase specifies this: https://www.dbase.com/Knowledgebase/INT ... le_fmt.htm
So I had to add 1900 to the year value (what I didn't made).
Wolfgang
AFAIK none of the DBF engines broke the DBF format of using only a 3 byte date.
Please see here: https://en.wikipedia.org/wiki/.dbf
My code was wrong here, I think.
DBase specifies this: https://www.dbase.com/Knowledgebase/INT ... le_fmt.htm
So I had to add 1900 to the year value (what I didn't made).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
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.
This here gives a much better explanation:
https://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![Smile :-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_smile.gif)
? 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![Wink ;-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_wink.gif)
regards
Karl-Heinz
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.
I know this site ...DBase specifies this: www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
This here gives a much better explanation:
https://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
![Smile :-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_smile.gif)
? 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
![Wink ;-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_wink.gif)
regards
Karl-Heinz
DBFs wanted
- Attachments
-
- TEST.zip
- (206 Bytes) Downloaded 45 times
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
DBFs wanted
Many thanks !
as expected, the value of the second byte is "0x12"
regards
Karl-Heinz
as expected, the value of the second byte is "0x12"
regards
Karl-Heinz