[fpc-devel] TSdfDataset does not work with records larger then 255 chars

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Mon Sep 8 14:32:36 CEST 2008


On 9/8/08, Martin Schreiber <fpmse at bluewin.ch> wrote:
> Possibly because FieldDefs[<n>].Size is too small. Did you setup
>  TSdfDataset.Schema according to your needs? The format is
>  <fieldname>=<fieldsize> AFAIK, MAXSTRLEN is a default value only. The new
>  MaxRecordLength property is actually unnecessary and a little bit misleading.

Indeed, but I can't find what needs to be fixed. I simply didn't set
my field sizes, and I would expect it to accept any sizes, and I
cannot find why it's cutted in the special value of 255.

Also note that the schema for TSdfDataset is different then for TFixedDataset.

I think the problem is somewhere in TSdfDataSet.InternalInitFieldDefs,
but the code is rather wierd and hard to understand. Even the high
readability of Pascal doesn't help in a code with a lot of short
whiles zero comments.

Even worse to debug, today it suddenly started working without any
code changes!! =(

It also works even if I change MaxRecordLength to 1, which proves that
this field is absolutely unnecessary.... I renamed it to
DefaultRecordLength. Didn't yet commit.

Another wierd thing is that it absolutely does not work (nothing is
read from database) if I don't set MaxRecordLength. The property has a
default value of 250, which somehow does not work, so I removed the
default in the property and initialized the value in the constructor,
which works.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-devel mailing list