TSQLQuery published properties lazarus / 7-LCL ---------------------------------------------------------------------- Lacak2 · 2009-02-18 11:20 Hi *, there are two published properties in TSQLQuery class: UsePrimaryKeyAsKey (inicialized in constructor with True), Upda]"]>Blockedde (inicialized in cosnstructor with upWhereKeyOnly) when I change value of some of these properies, changed value is not stored in ".lfm", so when I reopen project again my changed values are restored to defaults. I think there must be changed these lines in sqldb.pp : property Upda]"]>Blockedde : TUpda]"]>Blockedde read FUpda]"]>Blockedde write SetUpda]"]>Blockedde default upWhereKeyOnly;     property UsePrimaryKeyAsKey : boolean read FUsePrimaryKeyAsKey write SetUsePrimaryKeyAsKey default true; -Laco. ---------------------------------------------------------------------- Loesje · 2009-02-18 12:40 I think you are right, but maybe that Vincent can confirm? ---------------------------------------------------------------------- Lacak2 · 2009-02-19 09:06 Reported as bug http://mantis.freepascal.org/view.php?id=13207 ---------------------------------------------------------------------- Vincent Snijders · 2009-02-19 09:18 Moved the bug report to the fpc project. ---------------------------------------------------------------------- Loesje · 2009-02-22 10:57 Bug-report is nice, but I still don't have vincent's confirmation that adding a default value makes any sense here. I thought that default- values are only used so that a property is not written to the resource-file, if it's set to it's default value. But that it does not has any influence on setting the real value of the property while loading from resource. ---------------------------------------------------------------------- Vincent Snijders · 2009-02-22 14:04 Yes, it makes sense, because you set a value explicitly in the constructor. Something has changed in fpc 2.3.1. In previous fpc versions, if no default value was given, the streaming mechanism assume it is 0, false, low(enum) etc. I think this is still the case for boolean properties, but I am not sure. Now, if you set UsePrimaryKeyAsKey  to false, it is not streamed (certainly with fpc 2.2.2), and if you read it back, the constructor sets it to true, but the value false is not read (because not written). To make sure, that it is not assumed that false is the default, you should add the default modifier to the declaration. ---------------------------------------------------------------------- Loesje · 2009-02-22 17:26 Now I see, thanks. Fixed in trunk.