vb6中记录集的非特定行为

发布于 2024-09-25 12:03:36 字数 486 浏览 9 评论 0原文

尊敬的专家 我有以下问题 当我尝试从记录集中获取值时,它显示错误 查询是

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不一样的天空 2024-10-02 12:03:36

尝试使用游标类型 adOpenForwardOnly 和锁定类型 adLockReadOnly

try with cursor type adOpenForwardOnly and lock type adLockReadOnly

梦中的蝴蝶 2024-10-02 12:03:36

也许您需要像这样定义 temp Dim temp As Long

简单来说,溢出错误意味着该值不适合变量。

  • VB6 Integer 的取值范围为 -32,768 到 32,767
  • Long 的取值范围为 -2,147,483,648 到 2,147,483,647

Perhaps you need to define temp like this Dim temp As Long

In simple terms, an overflow error means that the value won't fit into the variable.

  • A VB6 Integer can take values from -32,768 to 32,767
  • A Long can take values from -2,147,483,648 to 2,147,483,647
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文