(DELPHI_XE)Datasnap 'ERROR_CODE'. The allowed range is 0 to 4294967295'
来源:互联网 发布:礼物网络销售方案 编辑:程序博客网 时间:2024/06/11 10:23
在用ADO+TClientDataSet操作数据库时,用DataSetProvider.ApplyUpdates更新时
可能会因为某种错误而提示如下:
Project Project1.exe raised exception class EDatabaseError with message '-2147217900 is not a valid value for field 'ERROR_CODE'. The allowed range is 0 to 4294967295'.
跟踪发现错误在 Provider.pas 中
procedure TUpdateTree.InitErrorPacket(E: EUpdateError; Response: TResolverResponse);var TrueRecNo: LongWord;begin with ErrorDS do begin if Assigned(Parent) then Parent.InitErrorPacket(nil, rrSkip); Self.Delta.UpdateCursorPos; Self.Delta.DSCursor.GetRecordNumber(TrueRecNo); if not Locate('ERROR_RECORDNO', Integer(TrueRecNo), []) then Append else Edit; if not Assigned(E) then begin if Response = rrSkip then begin SetFields([TrueRecNo]); Post; end else SetFields([TrueRecNo, 0, '', '', 0, 0]); end else SetFields([TrueRecNo, Ord(Response)+1, E.Message, '', 1, E.ErrorCode]); end;end;
的
SetFields([TrueRecNo, Ord(Response)+1, E.Message, '', 1, E.ErrorCode]);
这一句,只需要将这一句改成
SetFields([TrueRecNo, Ord(Response)+1, E.Message, '', 1, Variant(LongWord(E.ErrorCode))]);
即可。
因为delphi认为ErrorCode应该是LongWord,不应该出现负数,或者说SQLServer是使用int64来表示ErrorCode。
- (DELPHI_XE)Datasnap 'ERROR_CODE'. The allowed range is 0 to 4294967295'
- amchart Arg: Fraction out of range (0 to 1 allowed)
- Detected Maven Version: 3.0.2 is not in the allowed range 3.0.3.
- Detected Maven Version: 3.0.2 is not in the allowed range 3.0.3
- The table 'pre_common_session' is full, Error_code: 1114解决办法
- Failed to access the USB subsystem.VirtualBox is not currently allowed to access USB devices...
- Host '主机名' is not allowed to connect to the mysql server
- The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
- Only the Kotlin standard library is allowed to use the 'kotlin' package
- The incident LOST_EVENTS occured on the master. Message: error writing to the binary log, Error_code
- The incident LOST_EVENTS occured on the master. Message: error writing to the binary log, Error_code
- only one software management tool is allowed to run at the same time
- CodeIgniter “The filetype you are attempting to upload is not allowed.”解决
- Attempting to load the view of a view controller while it is deallocating is not allowed and may res
- Attempting to load the view of a view controller while it is deallocating is not allowed and may res
- host is not allowed to connect mysql
- hadoop is not allowed to impersonate hadoop
- is not within the allowed path
- 大话数据结构--概念
- Android的MediaPlayer架构介绍
- 中国天气预报城市代码
- 在配置文件中设置浏览器为兼容模式
- 拒绝平庸——打造产品气质三步法
- (DELPHI_XE)Datasnap 'ERROR_CODE'. The allowed range is 0 to 4294967295'
- parseint 转换类型有两个参数要注意细节
- 深入WPF--Style
- 截取url参数
- MongoDB c++ driver 2.5.x之前版本的下载
- python 描述器,及property 的实现
- Jodd 3.3
- java 从零开始,学习笔记之基础入门<Date类_Calendar类>(十七)
- javascript验证上传文件的类型限制必须为某些格式