[Lazarus] Is anyone working with the simple datasets?
Joost van der Sluis
joost at cnoc.nl
Tue Apr 15 10:17:16 CEST 2008
Op maandag 14-04-2008 om 20:35 uur [tijdzone -0300], schreef Felipe
Monteiro de Carvalho:
> On Mon, Apr 14, 2008 at 10:05 AM, Graeme Geldenhuys
> <graemeg.lists at gmail.com> wrote:
> > constructor TMainForm.Create(AOwner: TComponent);
> > var
> > fields: TDbfFieldDefs;
> >
> > begin
> > inherited Create(AOwner);
> > DataSet := TDBF.Create(Self);
> > DataSet.TableName := 'temp.dbf';
> ..........
>
> Thanks, this worked perfectly =) Maybe the problem with TDBf is that I
> was passing zero to the size of the string field. I had just thougth
> that I don't care about the size and giving zero would make it a field
> that can accept any size ...
You shoudn't think, but look it up. ;) Normally databases do not have
'sizeless' fields. That would be way too inefficient. There are BLOB's
(clob's?) for that purpose.
Note that if you define a string field with a size of 5000, for each
record 5000 bytes of memory will be allocated. Two such fields, 100
records and your dataset need at least 1 MB of memory....
Joost.
More information about the Lazarus
mailing list