I just want to report: After updating Lazarus from 1.8.2 to 2.0.10 (and again after I updated to 2.2, hoping the problem would go away), it regularly crashed at the database command "Post" when posting a string. (Commands: Edit; FieldByName('xxx').AsString := 'xxxx'; Post).
It took me two days to figure out why: Lazarus had given the field length ("Size") as something like 1000 or even 1024, as I finally found in the Object Inspector, although the field length of the database field (firebird) was only 255 [varchar(255)]. When I set the field length in the Object Inspector to the right value (Size: 255) everything went fine.
<snip>
I'm trying to understand what went wrong here. Firstly, you haven't said which Firebird database driver you are using. Also, have you used to Fields Editor to add the fields to the form, or are you relying on the fields to be dynamically created each time you open the dataset? You have said that you are using "FieldByName" and so I will assume the latter.
In general, all database drivers should work the same.
When you open a dataset, the FieldDefs collection should be automatically created by the InternalInitFieldDefs method. In IBX, InternalInitFieldDefs runs a query on the database and creates the fielddefs, including the Field Size, from the metadata returned by Firebird. It should be a proper reflection of the database schema - but will also depend upon the connection character set for VarChar. If the field is UTF8 encoded or the connection character set is UTF8 then the field size is four times the character size in order to cope with a maximum length UTF8 string.
The odd thing is that you said the crash occurred when an updated record was posted and that you needed to reduce the field size to make it work.This does not really add up.
Alternatively, if you had used the fields editor, then the field size is saved in the form. When you upgraded, the form would be unchanged and the field size remains unchanged. Maybe, in the previous version you had used a connection character set of UTF8 and hence the long field size and then after upgrade a single byte character set was used (e.g. ANSI). That would explain your problem.