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

Michael Van Canneyt michael at freepascal.org
Mon Sep 8 20:43:58 CEST 2008



On Mon, 8 Sep 2008, Felipe Monteiro de Carvalho wrote:

> On Mon, Sep 8, 2008 at 10:51 AM, Martin Schreiber <fpmse at bluewin.ch> wrote:
> > Did you open an existing datafile?
> 
> I am always working opening an existing datafile. So, you are thinking
> that it calculates the size for the fields upon loading and then it
> does not increase the field sizes when posting to the database?

There are 2 ways:

1. When opening an existing file, the longest existing line length is used as 
   the max record size if firstlineasschema is True. The lengths are not changed
   after that.

2. When creating a new file, the lengths are taken from the schema.

So:
I would imagine that in your case, you set firstlineasschema=False, and set the correct
lengths in Schema. That should do it.

A possible extension is that the schema is defined in the FieldDefs property,
and that this is used to parse the file.

Michael.



More information about the fpc-devel mailing list