数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
来源:互联网 发布:出货单打印软件免费版 编辑:程序博客网 时间:2024/05/17 01:01
所用的控件有:TDataSetProvider,TADOQuery,TClientDataSet
1.当 DataSetProvider.UpdateMode=upWhereAll 时,update时 where 是指定全部字段,比如,你有a、b、c 3个字段,修改了c字段,在app server中修改的命令是update ... set c=新c where a=旧a and b=旧b and c=旧c
如果 旧的a、b、c之一 已经被其他人改掉了,那where就找不到合适的记录来修改了。所以报告“记录被其他人修改”,这个问题和“锁定”是无关的。
2.当 DataSetProvider.UpdateMode=upWhereKeyOnly 时,update时 where 是指定key字段,比如,
你有a、b、c 3个字段,修改了c字段,a是key field在app server中修改的命令是update ... set c=新c where a=旧a (只比较a字段)你的程序应该设计为客户修改不到主键字段的值,这样你的客户只能修改到其他字段的值,其他字段不会出现在where中,就不会出现你说的问题了。
(用第2种方法解决,注意如果你的表原来没有主键的,需要双击dataset,添加你的所有field,在有唯一值的field的 ProviderFlasgs 属性里面 InKey 设置为 true (该field必须是有唯一值的,能相当于主键的,也就是能唯一确定该行记录的),TADOQuery,TClientDataSet控件里的唯一值的field字都要设置InKey为true)
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- [DataSet Error] Record not found or changed by another user
- clientdataset“Record not found or changed by another user”问题
- record not found or changed by another user 解决
- record not found or changed by another user 解决方法
- 关于Record not found or changed by another user的问题
- record not found or changed by another user 没有主键的表解决(外篇)
- 浮点数可能会导致更新ClientDataset出现"Record Changed by Another user"错误
- 删除数据时Record is locked by another user
- Oracle修改表中记录时出现record is locked by another user的问题
- 错误信息:Couldn't perform the edit because another user changed the record.
- oracle 表记录被locked的解决办法,record is locked by another user
- record is locked by another user
- record is locked by another user
- Record is locked by another user
- Openembedded local.conf文件配置笔记
- 如何在C++中调用C的代码
- 关于CSDN 新版本的一些建议
- Eclipse 3.7(代号Indigo)正式版发布!
- 如何迅速成为Java高手
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- Java Tutorial(Java操作MongoDB入门)
- Air C++调用
- Spring参考手册 mvc:annotation-driven
- VC2005从开发MFC ActiveX ocx控件到发布到.net网站的全部过程
- 从安装informix想开去
- opencv 读取摄像头
- 关于osip协议栈的优化
- C 指针解惑