Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime error 6 - overflow

Status
Not open for further replies.

SQLWilts

Programmer
Feb 12, 2001
651
GB
Hi,

We have an application written in VB6. It works fine, month after month. This month, when we try and run it we get an error message "Runtime Error 6 Overflow". The program has not changed (which is just as well as none of us is in a position to run the code or compile the source now - it runs on a server running IBM MQ software under Windows 2000.)
Any help/places to start looking would be appreciated
 
I've experienced a similar circumstance before with this error. What it turned out to be was I was storing the auto increment field into an integer data type. It would work fine all of the time and then one day I got the error and this was the problem. Anyway, that is what I would look for in your code.

Without see code examples and know more about the program, this is the best starting point...
 
Thanks bjd4jc. There is a load of code and we have no idea as to where this is falling over at the moment. It needs to be compiled over a certain environment that we don't have/not licensed to install on our laptops.
I will check out the possibility of an auto increment field first though
 
I once had this exact problem and the cause was just as bjd4jc describes.

The problem is that a value assigned to a variable becomes longer than the data type of that variable can hold.

Here is some information from the VB help file... maybe it will help you find a value in your database that exceeds one of these data types. The tabs will be messed up when I paste it but it shouldn't be too bad.
Code:
Data Type	Range 
----------	------
Byte		0 to 255.

Currency 	-922,337,203,685,477.5808 to 922,337,203,685,477.5807.

Double 		-1.79769313486232E308 to -4.94065645841247E-324 for negative values; 
		4.94065645841247E-324 to 1.79769313486232E308 for positive values.

Decimal		+/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, 
		numbers with no decimal places. For numbers with 28 decimal places, the range 
		is +/-7.9228162514264337593543950335. The smallest possible non-zero number 
		is 0.0000000000000000000000000001.
	
Integer		-32,768 to 32,767; fractions are rounded.

Long		-2,147,483,648 to 2,147,483,647; fractions are rounded.

Single		-3.402823E38 to -1.401298E-45 for negative values; 
		1.401298E-45 to 3.402823E38 for positive values.

Variant		Same range as Double for numerics

Also be aware that it is technically possible to overflow a text string... but I've never seen this happen.

The bad news is that if you can't recompile the code then your only option may be to archive some of your data and then re-start with an empty table.
 
You guys are absolutely right! We had a field that ended up with a calculated field (Long) value of 2253200000!!!

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top