800a000d 类型不匹配: 'cint'

来源:百度知道 编辑:UC知道 时间:2024/05/13 11:42:08
Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'cint'

/bossadmin/hire_update.asp,行 25

代码如下:
hire_place=CheckStr(trim(request("place")))
If hire_place="" or isnull(hire_place) Then
conn.close
set conn=nothing
response.write "<script language=javascript>alert('职位名称不能为空,请重新输入!');location.href='javascript:history.back()';</script>"
response.end
end if
hire_introduce=CheckStrbox(request("introduce"))
If lenmix(hire_introduce)>=8000 Then
conn.close
set conn=nothing
response.write "<script language=javascript>alert('错误:详细说明太长了,要求不多于8000个字符!!');location.href='javascript:history.back()';</script>"
response.end
end if
hire_dept=CheckStr(trim(request("dept")))
hire_type=cint(trim(request("type")))
hire_trade=cint(trim(reques

先看一下你变量定义的类型 然后再看一下你request("trade")的值 就知道原因了

传的trade值有问题, 或空或非数字..所以在转换过程当中自然就会出错..要想程序的容错性好一点, 可以自定义一个函数让他自动转换.如:
' default 指转换失败时使用的值
function toInt(byVal s, default)
s = s & ""
if s = "" or not isnumeric(s) then
toInt = default
else
toInt = clng(s)
end if
end function

上面的调用就可以用 hire_trade=toInt(trim(request("trade")), 0) 替换