Overflow CInt

Results 1 to 2 of 2

Thread: Overflow CInt

  1. #1
    Join Date
    Dec 1969

    Default Overflow CInt

    OK, I know what the error means. I know the value it&#039;s getting is too large, but when I try CLong, I get a Type Mismatch error.<BR><BR>ASP:<BR>I&#039;ve got 2 subdirectories on one server - one for development and another for production. After testing and development, I copy the file, change the the include connection screen to the connection file that connects to production, then I save it into the production directory.<BR><BR>ORACLE:<BR>I checked the table that this runs against (both on production and development). The only difference is the current value of the field being queried: production value is &#039;54843&#039; and development value is &#039;28088&#039;. They&#039;re both VARCHAR2(50) fields. <BR><BR>Back to ASP:<BR>When I retrieve the content, I am trying to increment it so I have to convert it to an integer first to add it to another number (otherwise, I get a mismatch error). What I&#039;m trying to understand is why I&#039;m getting the following error when I&#039;m using production, but not development:<BR><BR>Microsoft VBScript runtime error &#039;800a0006&#039; <BR>Overflow: &#039;CInt&#039; <BR>/isreports/d/adm-invusr.asp, line 142 <BR><BR>Here are lines 140-143:<BR> objRS.Open SQL,connDGP1,0,1<BR> ID = objRS(0)<BR> INTID = CInt(ID)<BR> objRS.Close<BR><BR>Any ideas? Should I be going to a database forum instead? (I&#039;m trying here first since I&#039;ve had such a great history with getting answers here). I&#039;m not sure if this is a database, asp or web server issue. Can anyone offer any advice?

  2. #2
    Join Date
    Dec 1969

    Default Limit is 32767

    CINT() can only be used for values between -32768 and +32767.<BR><BR>Use CLNG() for values between +/- 2 billion.<BR><BR>I have no idea why CINT() was left in the VBS language. It harkens back to the days of 8 bit computers. Vintage 1983 and before.<BR><BR>Just take CINT() out of your "vocabulary". Same as CSGL(). No real use for it and it can only lead to errors.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts