Unidac:解决“trying to modify read-only Field”问题!
2010-12-19 17:01
330 查看
后台使用SQL语句中,经常会关联自定义函数或视图,而CDS(TClientDataSet)对字段校验比较严格,涉及到的自定义函数或视图输出的字段,都会强制改为ReadOnly为True属性。
当后台使用UniDAC+CDS,关联视图或自定义函数,为了数据一致性,有可能需要在前台界面上修改CDS相关的自定义函数输出的字段,即便是将 该字段设置为 readonly为false,或将其字段的 FieldDefs属性的attributes的faReadOnly去掉,系统也会抛出一个异常:trying to modify read-only Field。
解决问题很简单,将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.
当后台使用UniDAC+CDS,关联视图或自定义函数,为了数据一致性,有可能需要在前台界面上修改CDS相关的自定义函数输出的字段,即便是将 该字段设置为 readonly为false,或将其字段的 FieldDefs属性的attributes的faReadOnly去掉,系统也会抛出一个异常:trying to modify read-only Field。
解决问题很简单,将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.
相关文章推荐
- Unidac:解决“trying to modify read-only Field”问题!
- 我都要疯了,三层,客户端clientdataset+dbgrid, 在编辑dbgrid时,修改记录后,老出现:“Trying to modify read-only field”
- IntelliJ maven项目pom文件错误failed to read artifact descriptor for xx.jar问题解决办法
- 解决:“ Failed to read candidate component class: file”问题
- Unable to chmod ***: Read-only file system问题的解决方法
- (转)解决dubbox-demo-provider.xml报错的问题:提示Failed to read schema document
- 解决Django+sqlite3 attempt to write a readonly database问题
- java中Failed to read candidate component class的问题解决
- Failed to read artifact descriptor for xxx:jar的问题解决
- [笔记]--解决 Error while trying to retrieve text for error ORA-12154 的问题
- platform builder was unable to read the device settings from the datastore问题解决
- [原]问题解决:/etc/fstab is read-only(add ! to override)
- platform builder was unable to read the device settings from the datastore问题解决
- Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'问题解决方法
- 问题解决:/etc/fstab is read-only(add ! to override)
- 解决eclipse载入已有maven工程时出现的fail to read artifact descriptor....问题
- 多方通话的时候遇到图片回收问题---目前没有方法解决 Canvas: trying to use a recycled bitmap android.graphics.Bitmap
- Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'问题解决方法
- Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'问题解决方法
- Unable to chmod ***: Read-only file system问题的解决方法