overflow error

M

MFA

Hi All

I am getting this error.

Microsoft VBScript runtime (0x800A0006)
Overflow: '[number: 32768]'


I am using if and case statments a lot, at certain point when I am just
putting another case statment its giving me this error. if I am removing
that line its OK
same code I tried with if conditions and clng(objRec("TEMP_TYPE"))

Here is my code

TEMP_TYPE = cint(objRec("TEMP_TYPE"))

SELECT CASE TEMP_TYPE
CASE 1
%>
<!--#include file="M_Templat1.asp" -->
<%
case 2
%>
<!--#include file="M_Templat2.asp" -->
<%
case 3
%>
<!--#include file="M_Templat3.asp" -->
<%
END SELECT
any one know whats problem.
Is there any limit to put if and else statements in asp page ?

kind regards
 
M

Manohar Kamath [MVP]

The line in question is most probably:

TEMP_TYPE = cint(objRec("TEMP_TYPE"))

You are converting the Temp_type to an Int, whose max limit is 32768. Try
converting into a Long instead

TEMP_TYPE = CLng(objRec("TEMP_TYPE"))

Also, before converting, check what value the Temp_Type contains, perhaps a
Null even? So, check

If IsNull(objRec("TEMP_TYPE")) Then
TEMP_TYPE = 0
Else
TEMP_TYPE = cint(objRec("TEMP_TYPE"))
End If
 
M

MFA

Thanks for your reply..

I have checked with cint(objRec("TEMP_TYPE")) and clng(objRec("TEMP_TYPE"))
.. I am only processing it when its not null.

any way thanks again for your time and reply..

regards



Manohar Kamath said:
The line in question is most probably:

TEMP_TYPE = cint(objRec("TEMP_TYPE"))

You are converting the Temp_type to an Int, whose max limit is 32768. Try
converting into a Long instead

TEMP_TYPE = CLng(objRec("TEMP_TYPE"))

Also, before converting, check what value the Temp_Type contains, perhaps a
Null even? So, check

If IsNull(objRec("TEMP_TYPE")) Then
TEMP_TYPE = 0
Else
TEMP_TYPE = cint(objRec("TEMP_TYPE"))
End If


--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com


MFA said:
Hi All

I am getting this error.

Microsoft VBScript runtime (0x800A0006)
Overflow: '[number: 32768]'


I am using if and case statments a lot, at certain point when I am just
putting another case statment its giving me this error. if I am removing
that line its OK
same code I tried with if conditions and clng(objRec("TEMP_TYPE"))

Here is my code

TEMP_TYPE = cint(objRec("TEMP_TYPE"))

SELECT CASE TEMP_TYPE
CASE 1
%>
<!--#include file="M_Templat1.asp" -->
<%
case 2
%>
<!--#include file="M_Templat2.asp" -->
<%
case 3
%>
<!--#include file="M_Templat3.asp" -->
<%
END SELECT
any one know whats problem.
Is there any limit to put if and else statements in asp page ?

kind regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top