Tahkas_ki
07-25-2003, 10:12 AM
I am trying to covert a 20 digit string, that is posted to the code below, to a number then I query a Sybase
database, based on the new 20 digit number. The datatype that I am trying to compare it to in sybase is numeric(20). I am new at ASP like 2 days so have pitty on ME!! I seem to remember that ASP - IIS 5.0 has
problems with large numbers.
Here is the code. You can see the error at the very bottom.
*******
<% @Language=VBScript %>
<% Option Explicit %>
<!--#include file="catuity.asp" -->
<%
Dim cardnumber, strCard, intCard, objConn, sQuery, objSet
strCard=trim(request.form("cardnumber"))
If strCard = "" then
response.redirect ("cardenter.asp?error=3")
End If
If IsNumeric(strCard) then
intCard = CInt(strCard)
Else
response.redirect ("cardenter.asp?error=2")
End If
Set objConn = Server.CreateObject("ADODB.Connection")
Set objSet = Server.CreateObject("ADODB.RecordSet")
objConn.ConnectionString = gConnectInfo
objConn.Open
sQuery = "select external_id, card_serial " _
& "from card " _
& "where external_id = " & intCard
objSet.Open sQuery, objConn, 0
IF objSet.EOF = True Then
response.redirect ("login.asp?error=1")
End If
Response.Write "<B>" & objSet.Fields("card_serial").Value & "</B>" &
gCRLF
objSet.Close
Set objSet = Nothing
objConn.Close
Set objConn = Nothing
%>
*******
Error Type:
Microsoft VBScript runtime (0x800A0006)
Overflow: 'CInt'
/new/just/verifycard.asp, line 16
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
POST 45 bytes to /new/just/verifycard.asp
POST Data:
cardnumber=78935784216000000001&submit=submit
database, based on the new 20 digit number. The datatype that I am trying to compare it to in sybase is numeric(20). I am new at ASP like 2 days so have pitty on ME!! I seem to remember that ASP - IIS 5.0 has
problems with large numbers.
Here is the code. You can see the error at the very bottom.
*******
<% @Language=VBScript %>
<% Option Explicit %>
<!--#include file="catuity.asp" -->
<%
Dim cardnumber, strCard, intCard, objConn, sQuery, objSet
strCard=trim(request.form("cardnumber"))
If strCard = "" then
response.redirect ("cardenter.asp?error=3")
End If
If IsNumeric(strCard) then
intCard = CInt(strCard)
Else
response.redirect ("cardenter.asp?error=2")
End If
Set objConn = Server.CreateObject("ADODB.Connection")
Set objSet = Server.CreateObject("ADODB.RecordSet")
objConn.ConnectionString = gConnectInfo
objConn.Open
sQuery = "select external_id, card_serial " _
& "from card " _
& "where external_id = " & intCard
objSet.Open sQuery, objConn, 0
IF objSet.EOF = True Then
response.redirect ("login.asp?error=1")
End If
Response.Write "<B>" & objSet.Fields("card_serial").Value & "</B>" &
gCRLF
objSet.Close
Set objSet = Nothing
objConn.Close
Set objConn = Nothing
%>
*******
Error Type:
Microsoft VBScript runtime (0x800A0006)
Overflow: 'CInt'
/new/just/verifycard.asp, line 16
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
POST 45 bytes to /new/just/verifycard.asp
POST Data:
cardnumber=78935784216000000001&submit=submit