Author Topic: TDbf and Required fields  (Read 411 times)


  • Guest
TDbf and Required fields
« on: August 30, 2019, 11:30:42 am »
Hello everyone,,
i'm trying to figure out how to set some fields in a TDbf table as mandatory. I supposed that the FieldDefs.Add function will do it, specifying the last parameter (Required) but nothing to do.
The fields are created but the Required flag is not set.
I've tried each dbf Level, from dBase III to FoxPro, but still not working.
Here's a sample of my code, what's wrong in it?

DbfFile.FieldDefs.Add('descr', 0, 7, True);
« Last Edit: September 06, 2019, 10:42:07 am by marcov »


  • Hero Member
  • *****
  • Posts: 3488
Re: TDbf and Required fields
« Reply #1 on: August 30, 2019, 12:53:06 pm »
AFAIK the Required flag is present in TDbf (since the file format specification 'requires' it - pardon the pun), but the functionality you would expect as a result of its presence is not currently implemented.
TDbf was regarded as deprecated for a long time, but it refuses to die because of the number of legacy databases still in use.
I expect a patch to implement the potential functionality would be accepted.


TinyPortal © 2005-2018