I am getting a run time error '6' Over Flow in vb 6
在vb 6中,我得到一个运行时错误'6' / Flow
3 个解决方案
#1
3
The "Overflow" error means that you are trying to put a number into a variable (or property etc), and the data type of the variable doesn't allow numbers that large.
“溢出”错误意味着您正在尝试将一个数字放入一个变量(或属性等),并且该变量的数据类型不允许有这么大的数字。
Make sure that numbers used in calculations that are coerced into integers do not have results larger than integers.
确保计算中使用的被强制成整数的数字的结果不大于整数。
#2
1
What is the type of the data in the database?
数据库中的数据类型是什么?
My guess is that ADO returns it as either a String or a Decimal, and Decimal values only "fit into" a Variant in VB6.
我的猜测是,ADO将它作为字符串或小数返回,而Decimal值仅“适合”VB6中的一个变体。
VB6 has no syntax for a Decimal literal, however you can use something like:
VB6没有十进制文字的语法,但是您可以使用以下内容:
CDec(111010114289@)
... inline, or declare a Const as in:
…内联,或声明一个Const,如:
Private Const BigVal As Currency = 111010114289@
#3
0
I you have to put a large number in a small variable, like C, check Remove integer bound check in project properties (if you are not compiling as PCode)
我你必须在一个小的变量中放入一个大的数字,比如C,检查删除整数绑定检查项目属性(如果你不是作为PCode编译的话)
#1
3
The "Overflow" error means that you are trying to put a number into a variable (or property etc), and the data type of the variable doesn't allow numbers that large.
“溢出”错误意味着您正在尝试将一个数字放入一个变量(或属性等),并且该变量的数据类型不允许有这么大的数字。
Make sure that numbers used in calculations that are coerced into integers do not have results larger than integers.
确保计算中使用的被强制成整数的数字的结果不大于整数。
#2
1
What is the type of the data in the database?
数据库中的数据类型是什么?
My guess is that ADO returns it as either a String or a Decimal, and Decimal values only "fit into" a Variant in VB6.
我的猜测是,ADO将它作为字符串或小数返回,而Decimal值仅“适合”VB6中的一个变体。
VB6 has no syntax for a Decimal literal, however you can use something like:
VB6没有十进制文字的语法,但是您可以使用以下内容:
CDec(111010114289@)
... inline, or declare a Const as in:
…内联,或声明一个Const,如:
Private Const BigVal As Currency = 111010114289@
#3
0
I you have to put a large number in a small variable, like C, check Remove integer bound check in project properties (if you are not compiling as PCode)
我你必须在一个小的变量中放入一个大的数字,比如C,检查删除整数绑定检查项目属性(如果你不是作为PCode编译的话)