如何使用 Fieldkind 为fkInternalCalc?

zhangjun 2000-03-15 09:51:00
...全文
367 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangjun 2000-03-15
  • 打赏
  • 举报
回复
ftInternalCalc 字段不触发 ONCALCULATED 事件,怎么做自动计算呢?
zhangjun 2000-03-15
  • 打赏
  • 举报
回复
关键是怎样又做自动计算又能写入数据库呢?
kxy 2000-03-15
  • 打赏
  • 举报
回复
Note: Fields calculated by SQL servers or the Borland Database Engine to display the results of a query that returns a live dataset have a FieldKind of fkInternalCalc, not fkCalculated. This is because the field values are stored in the dataset. Calculated fields in a client dataset are calculated in an OnCalcFields event handler, but stored internally in the dataset. They also have a FieldKind of fkInternalCalc instead of fkCalculated. Unlike regular calculated fields, these fields can be used in filter expressions. They can also edited, but the changes are discarded. To prevent editing, set the ReadOnly property to True.

Note: The FieldKind property of a field is only stored with the field object if the value is fkInternalCalc.
所以,直接指定一个字段是fkInternalCalc即可,fkInternalCal和fkCalculated
不同的是,fkInternalCal字段的值是写入到库中的

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧