[Lazarus] Can't create calculated field

John Landmesser JohnML at online.de
Sun Dec 30 15:55:31 CET 2012


In Delphi 5 i would give you this advice; perhaps update the FieldList?!

  SQLQuery1.FieldDefs.Clear;

.. add  your Field ..

SQLQuery1.FieldDefs.Update;



Am 30.12.2012 15:26, schrieb Krzysztof:
> Hi,
>
> I have this code:
>
>   f := TField.Create(FDataList);
>   f.FieldName := 'calc';
>   f.FieldKind := fkCalculated;
>   f.SetFieldType(ftBoolean);
>   f.DataSet   := SQLQuery1.FieldDefs.Dataset;
>
>
> procedure TForm1.OnCalc(DataSet: TDataSet);
> begin
>   SQLQuery1.FieldByName('calc').AsBoolean := true;
> end;
>
> But I get error "Invalid type conversion to Boolean in field calc"
>
> Regards
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121230/3ec138c6/attachment-0003.html>


More information about the Lazarus mailing list