解决“trying to modify read-only Field”问题!

后台使用SQL语句中,经常会关联 自定义函数 视图 ,而CDS(TClientDataSet)对字段校验比较严格,涉及到的自定义函数或视图输出的字段,都会强制改为ReadOnly为True属性。
当后台使用UniDAC+CDS,关联视图或自定义函数,为了 数据一致性 ,有可能需要在前台界面上 修改 CDS相关的自定义函数 输出的字段 ,即便是将 该字段设置为 readonly false ,或将其字段的 FieldDefs 属性的 attributes faReadOnly 去掉,系统也会抛出一个异常:trying to modify read-only Field。
解决“trying to modify read-only Field”问题! - yyimen - yyimen的博客
解决问题很简单,将TUniQuery.Options. SetFieldsReadOnly false 即可。
查一下TUniQuery.Options. SetFieldsReadOnly的帮助,这样写道:
If True, dataset sets the ReadOnly property to True for all fields that do not belong to UpdatingTable or can not be updated. Set this option for datasets that use automatic generation of the update SQL statements only.



        
        



        







        
          
            
            评论这张
          
        


          
            
               解决“trying to modify read-only Field”问题! - yyimen - yyimen的博客
            
            转发至微博
          
        
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值