Sarath wrote:
I am working with an application using ASP, getting below error when
i am trying to include new asp include file.
_______________ _______________ _______________ _______________ _________
Microsoft VBScript runtime error '800a0006'
Overflow: '[number: 33994]'
_______________ _______________ _______________ _______________ ________
I am sure that there is no error in the new asp file as if i delete
any existing include file then no issues.
This is dynamic include and currently we are loading around 800
include files.
Is there any maximum limit for number of include files limitation in
ASP?
No, the problem is more likely an attempt in your include file to use an
Integer when you should be using a Long. Go through the code, especially
where any multiplication or addition occurs, and explicitly cast the
variables involved in the calculations as Longs using the CLng function.
Remember, the result of the addition or multiplication of two Integers is
required to be an Integer (max 32678). If the result of the operation is
greater than 32678, you get an overflow. For example:
dim x, y, z
x=2
y=16997
'these are stored as Integer by default
on error resume next
response.write "Without CLng():<BR>"
z=x*y
if err<>0 then
response.write err.description
err.clear
else
response.write z
end if
response.write "<BR>Using CLng():<BR>"
z=clng(x) * clng(y)
if err<>0 then
response.write err.description
err.clear
else
response.write z
end if
In order to guarantee that vbscript reserves enough space for the result of
the calculation, you need to cast the operands as Longs before performing
the operation. This forces vbscript to reserve space in memory for a Long
value instead of an Integer.
HTH,
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"