类型不匹配代码求解 :Cint

来源:百度知道 编辑:UC知道 时间:2024/06/01 05:42:58
运行时:出现错误:
商品名称 市场价 会员价 数量 小计 修改数量
Microsoft VBScript 运行时错误 错误 '800a000d'
类型不匹配: 'CInt'

/moto/cart.asp,行 9

部分ASP代码如下:
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select id,name,price1,price2,vipprice,discount,score,stock from product where id in ("&id&")",conn,1,1
sum1=0
sums1=0
bookscount=request.QueryString("id").count
do while not rs.eof
Quatity = CInt( Request( "shop"&rs("id")) )
If Quatity <=0 Then Quatity = 1
if rs("stock")<100000000000000000 then
strscore=rs("score")
strprice1=rs("price1")
strprice2=rs("price2")

%>

CInt( Request( "shop"&rs("id")) )
大汗啊
改成
CInt( Request( rs("id")) )

CInt(参数) 是把一个数转换为整型,参数必须是数字.

出现错误,说明你的 Request("shop"&rs("id")) 获取到的不是数字,里面可能还包含有字符串(比如空格).你自己检查检查.

PS:或者可以尝试一下把CInt换成CCur

Request( "shop"&rs("id")) 中不对

cint(Request("shop")&rs("id"))