Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please help
Message
 
To
06/04/1998 05:15:34
Nam Tran Hoai
Institute of Information Technology
Hanoi, Vietnam
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00089711
Message ID:
00089722
Views:
27
>I want to know about structure of Foxpro database files(*.dbf). Plwase contact to me as soon as posible.
>Thanhks a lot

This is my header structure written in C.

struct DBF_HEADER
{
unsigned char versiontype;
unsigned char hd_year;
unsigned char hd_mnth;
unsigned char hd_day;
unsigned long tot_recs;
unsigned int hdr_size;
unsigned int rec_len;
unsigned char misc1[16];
unsigned char cdx_ind;
unsigned char misc2[3];
};

This is, however, a very old version - there is more info in misc1 and misc2 which I forget what they are. Versiontype I believe is chr(3) for 2.6 - this changes for vfp. hd_year,hd_mnth,hd_day are the last update date. hdr_size is the size of this header. cdx_ind is normall NULL but not if there is a cdx attached to the dbf.
Following this header, for each field you will find this structure:

struct DBF_FLDINFO
{
char fld_name[11];
char fld_type;
long fld_offset;
unsigned char fld_len;
char fld_decim;
char not_used[14];
}

fld_offset is the offset from the beginning of the record. fld_decim I think is extra to fld_len. I think you will find either NULL or EOF (chr(26)) at the end of the list of fields. The rest of the file is pure data with no separators between fields or records with an EOF at the end of the file. Hope this is what you require.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform