vb6中记录集的非特定行为
尊敬的专家 我有以下问题 当我尝试从记录集中获取值时,它显示错误 查询是
SSql =“从m_employee中选择doj,dol,employeeid,其中employeeid ='”&修剪(RsCardNo!代码)& “'” rsCardRepl.Open SSql、Conn、adOpenDynamic、adLockOptimistic
如果 rsCardRepl.RecordCount > 0 然后 昏暗温度为整数 temp = Trim(rsCardRepl!employeeId) rsAddPunch!PAYCODE = 临时 End If
Then 下面的行给出错误
temp = Trim(rsCardRepl!employeeId)
错误 Number=6 错误描述 =Overflow
请解释一下为什么会出现此错误以及解决方案是什么
谢谢 海军基肖尔·潘迪
Dear Expert
i have the following problem
when i try to get the value from the record set it showing error
the query is
SSql = "select doj,dol,employeeid from m_employee where employeeid='" & Trim(RsCardNo!Code) & "'"
rsCardRepl.Open SSql, Conn, adOpenDynamic, adLockOptimistic
If rsCardRepl.RecordCount > 0 Then
Dim temp As Integer
temp = Trim(rsCardRepl!employeeId)
rsAddPunch!PAYCODE = temp
End If
Then the following line giving the error
temp = Trim(rsCardRepl!employeeId)
The error Number=6
Error Description =Overflow
Would please explain me why this error is coming and what is the solution
Thanks
Naval Kishor Pandey
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用游标类型 adOpenForwardOnly 和锁定类型 adLockReadOnly
try with cursor type adOpenForwardOnly and lock type adLockReadOnly
也许您需要像这样定义
temp
Dim temp As Long
简单来说,溢出错误意味着该值不适合变量。
Integer
的取值范围为 -32,768 到 32,767Long
的取值范围为 -2,147,483,648 到 2,147,483,647Perhaps you need to define
temp
like thisDim temp As Long
In simple terms, an overflow error means that the value won't fit into the variable.
Integer
can take values from -32,768 to 32,767Long
can take values from -2,147,483,648 to 2,147,483,647