数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
来源:互联网 发布:手机数据连接上不了网 编辑:程序博客网 时间:2024/05/16 14:00
所用的控件有: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
- python数据格式化之pprint
- LL(1)分析法(简单版)_C++实现
- Linux下搭建ftp服务
- 英语标点符号及翻译
- mybatis防止sql注入
- 数据保存时,出现‘record not found or changed by another user’错误信息的解决办法
- Broadcast流程1--注册广播
- python黑帽子之netcat(chapter1)
- org.apache.http不存在或找不到,解决方案
- pollard's rho算法(使用GMP库)
- 精通CSS(4.4opacity&RGBa)&&黑客与画家(2)
- 【Oracle】单行函数
- 欢迎使用CSDN-markdown编辑器
- 岛屿的数量(思维)