ASP运行时出错.怎么解决

来源:百度知道 编辑:UC知道 时间:2024/05/22 06:15:43
错误类型:
Microsoft VBScript 运行时错误 (0x800A005E)
无效使用 Null: 'Cint'
/student/student/utility/check.asp, 第 22 行

<!-- #include file="const.asp" -->

<%
'****************************************
'目的: 检查学生是否成功登陆
'开始时间: 2005-5-31
'最后修改时间: 2005-5-31
'编写人: 某某某
'****************************************

if(Session("userID") = "" or Session("userType") <> "student") then
Alert("对不起,您的登陆信息有误或者超时,请登陆后进入系统!")
Go("../index.htm")
Response.end
end if

'***************************************
'目的:依据参数判断用户是否能访问该页面
'参数:needFlag需要的等级
'***************************************
Sub CheckFlag(n

参数错误,Cint函数不接受NULL类型参数,
Cint函数接受参数的类型:字符、字符串、所有数值类型
Cint(Session("userCheck")&"")就不会出错。
解析:任何数据类型加个空字符串结果都是字符串类型。

if(Isnumeric(Cint(Session("userCheck")&"")) and Cint(Session("userCheck")&"") < needFlag) then

楼上真是罗嗦,简单的写:
if Session("userCheck") > "" and isnumberic(Session("userCheck") then
  if Cint(Session("userCheck")) < needFlag then alert...权限不够
else
aert...没有登录
end if