<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
In Delphi 5 i would give you this advice; perhaps update the
FieldList?!<br>
<br>
SQLQuery1.FieldDefs.Clear;<br>
<br>
.. add your Field ..<br>
<br>
SQLQuery1.FieldDefs.Update;<br>
<br>
<br>
<br>
Am 30.12.2012 15:26, schrieb Krzysztof:
<blockquote
cite="mid:CACLODVD5mj9dBwvjsqNySHjg0QzLG40Pa0m9q9BTh4NXYgHCAw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I have this code:</div>
<div><br>
</div>
<div>
<div> f := TField.Create(FDataList);</div>
<div> f.FieldName := 'calc';</div>
<div> f.FieldKind := fkCalculated;</div>
<div>
f.SetFieldType(ftBoolean);</div>
<div> f.DataSet := SQLQuery1.FieldDefs.Dataset; </div>
<div><br>
</div>
<div><br>
</div>
<div>procedure TForm1.OnCalc(DataSet: TDataSet);</div>
<div>begin</div>
<div> SQLQuery1.FieldByName('calc').AsBoolean := true;</div>
<div>end; </div>
</div>
<div><br>
</div>
<div>
<div>But I get error "Invalid type conversion to Boolean in
field calc"</div>
<div><br>
</div>
<div>Regards</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
<br>
</body>
</html>