Data types and limitations in dbf files

344 views
Skip to first unread message

CV

unread,
Dec 8, 2015, 4:18:29 PM12/8/15
to Harbour Users
Hi

Does anyonoe know what are the field types and its size/limits while creating a DBF file, supported by Harbour?

For example, in xHarbour there is data type "D" (date), whose size could be 3, 4 or 8 bytes long.
If I opted for length = 8 I obtain a date in "YYYYMMDD" format (ascii) while writing to the file, and a binary format otherwise (that is, not directly readable).

There are some other aproachs for field type "N", maybe packed or binary (not directly readable for the human eye).

I wish to know if there is some document somewhere that explains what formats are supported by Harbour.

Regards,
---
Claudio Voskian

CV

unread,
Dec 8, 2015, 4:29:42 PM12/8/15
to Harbour Users

Klas Engwall

unread,
Dec 8, 2015, 9:04:17 PM12/8/15
to harbou...@googlegroups.com
Hi Claudiom
Here is the field type list from include\hbapirdd.h

/* Field types */
#define HB_FT_NONE 0
#define HB_FT_STRING 1 /* "C" */
#define HB_FT_LOGICAL 2 /* "L" */
#define HB_FT_DATE 3 /* "D" */
#define HB_FT_LONG 4 /* "N" */
#define HB_FT_FLOAT 5 /* "F" */
#define HB_FT_INTEGER 6 /* "I" */
#define HB_FT_DOUBLE 7 /* "B" */
#define HB_FT_TIME 8 /* "T" */
#define HB_FT_TIMESTAMP 9 /* "@" */
#define HB_FT_MODTIME 10 /* "=" */
#define HB_FT_ROWVER 11 /* "^" */
#define HB_FT_AUTOINC 12 /* "+" */
#define HB_FT_CURRENCY 13 /* "Y" */
#define HB_FT_CURDOUBLE 14 /* "Z" */
#define HB_FT_VARLENGTH 15 /* "Q" */
#define HB_FT_MEMO 16 /* "M" */
#define HB_FT_ANY 17 /* "V" */
#define HB_FT_IMAGE 18 /* "P" */
#define HB_FT_BLOB 19 /* "W" */
#define HB_FT_OLE 20 /* "G" */

Regards,
Klas

Przemyslaw Czerpak

unread,
Dec 9, 2015, 3:12:05 AM12/9/15
to harbou...@googlegroups.com
Hi,

Harbour RDDs are supersets of xHarbour ones.
It means that Harbour supports all fields supported by xHarbour
and also few other ones, i.e. unicode fixed, variable length and
memo strings. In some spare time I'll create full list.
Anyhow in the link you send there are some mistakes, i.e. "V"
fields describes FS "V" fields not [x]Harbour one which is SIx3
compatible (variable field length for any types) or VFP (variable
length string) if table has VFP signature - [x]Harbour does not
support FS compatible .DBV files. Only [x]Harbour supports
fields like I:1,2,3,8 or D:3 and VFP supports only I:4 and D:4
fields, memo fields like M, P, B, H can use 10 or 4 bytes for
memo file reference, etc.

best regards,
Przemek
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
> ---
> You received this message because you are subscribed to the Google Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

esgici

unread,
Dec 9, 2015, 5:36:40 AM12/9/15
to Harbour Users

CV

unread,
Dec 9, 2015, 4:16:42 PM12/9/15
to Harbour Users
Hi Przemek, Klas and Esgici

Many thanks for the hints.

Best regards,
Claudio Voskian
Reply all
Reply to author
Forward
0 new messages