Page 1 of 1

reading FoxPro .dbf file metadata?

Posted: Wed Jul 14, 2010 5:49 am
by dsimpson
I know that previously Bob Sneidar had posted info about reading metadata from .dbf files.

I am wondering if this code was uploaded or made available somewhere, as I have a need to perform the same task. If I can read enough metadata from .dbf files, then I can attempt to perform the conversion of an entire FoxPro database into a Revolution stack utilizing a SQL database backend.

I don't need to use Rev to read the actual data from the .dbf files, I have other software to perform that task. I just need to be able to read the low-level metadata for field name, field type, NULL status, UNIQUE status, and primary key status of fields.

David Simpson
http://www.fmpromigrator.com

Re: reading FoxPro .dbf file metadata?

Posted: Wed Jul 14, 2010 6:17 am
by Janschenkel
Hi David,

Here's a pretty good explanation of the .dbf file structure, including the 'header' that contains the metadata:
http://www.clicketyclick.dk/databases/x ... t/dbf.html
One .dbf file contains a single table of the database (except for the 'memo' long text fields, which are stored in a separate .fpt file)

HTH,

Jan Schenkel.

Re: reading FoxPro .dbf file metadata?

Posted: Wed Jul 14, 2010 11:44 am
by doc
You will also find a couple of very well detailed files at the Wotsit site: http://www.wotsit.org/

=Doc-

Re: reading FoxPro .dbf file metadata?

Posted: Wed Jul 14, 2010 4:41 pm
by dsimpson
Thanks Jan and Doc. I have looked at some of this info previously and was trying to avoid reinventing the wheel. But upon looking at it again, it might not be that time consuming to just write it all from scratch. Besides, I am going to need the backlink list from .DBC files anyhow, and don't see much of any other way to get that info.