[Patch] DBase export: Observe field name length limits for DBaseIV,VII,Foxpro
Original Reporter info from Mantis: BigChimp
-
Reporter name: Reinier Olislagers
Original Reporter info from Mantis: BigChimp
- Reporter name: Reinier Olislagers
Description:
In packages\fcl-db\src\export\fpdbfexport.pp
These tablelevels/formats are defined:
TTableFormat = (tfDBaseIII,tfDBaseIV,tfDBaseVII,tfFoxPro);
function TFPCustomDBFExport.BindFields: Boolean;
there is this part (line 136):
If FormatSettings.AutoRenameFields and
(FormatSettings.TableFormat=tfDbaseIII) then
CheckExportFieldNames;
only checks for DBaseIII and ignores field length limit for the other supported formats.
Attached is a patch that addresses this.
Additional information:
As best as I could figure out: the following field size limits are present for
the various DBase formats:
3: DBase III: 10 characters
4: DBase IV: 10 characters
7: DBase VII: 32 characters
8: FoxPro: 10 characters
3,4: http://www.clicketyclick.dk/databases/xbase/format/dbf.html#DBF_STRUCT
7: IIRC, from http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm
(forwarded by Wikipedia), but that page is down now
8:
http://www.dynamic.com/v7/what-are-limitations-foxpro-full-isam-file
http://www.foxite.com/archives/foxpro-field-names-0000066805.htm
Apparently Visual FoxPro 8 has 27 characters in a DBC (Database
container) file, but only 10 in a DBF file.
Mantis conversion info:
- Mantis ID: 20134
- OS: Windows
- OS Build: Vista
- Build: FPC git 2 September 2011
- Platform: x64
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 18944 (#13840ad9)
- Target version: 2.6.0