You are not logged in.
Pages: 1
hi,
i have problem with default value.
i add fTest field for table TSQLFile on MainDemo project like following:
TSQLFile = class(TSQLRecordSigned)
public
fName: RawUTF8;
..
fTest:Boolean;
published
property Name: RawUTF8 read fName write fName;
...
property Test: Boolean read fTest write fTest default True;
end;
but if i insert new record, with ignoring Test field, the Test field is set to 0 (not 1 as expected on default value).
and if add new field (TSQLFile have contained data)
property Test2: Boolean read fTest2 write fTest2 default True;
then Test2 value will null (not 1 as expected on default value)
and then error will occured on DrawcheckBox in SQLite3UI unit.
thanks
Offline
The default value is not set by the framework at TSQLRecord level.
It's by design, and this default property was never documented to work.
Even at the VCL level, default is only working when loading the components from a DFM stream.
When you create a TObject at runtime, its default value is not set.
The ORM has the same exact behavior: all TSQLRecord objects created don't have their default value set.
Online
Pages: 1