提示:类型不匹配: 'cint' (高分请教呀)

panjisheng 2003-11-16 09:36:14
Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'cint'

/club2/forum.asp,行234

-------------------------------
如何解决啊?
我用是IIS 5
win2k server
...全文
222 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
panjisheng 2003-11-17
  • 打赏
  • 举报
回复
在它前面添加
这个就没有出错提示了!

response.write "<br>wsetup(3)=" & wsetup(3)
response.end
if cint(wsetup(3))=1 then
myCache.name="userbirthday"
if myCache.valid then
response.write myCache.value
'mycache.makeEmpty
。。。。。。。。。。。。
Tal 2003-11-17
  • 打赏
  • 举报
回复
cint("0" & wsetup(3))
lovehwq21 2003-11-17
  • 打赏
  • 举报
回复
你的wsetup(3)值为空或者不是数字型,当你用cint的时候,强制转换为不过来,就会出错了,所以,一般要保证wsetup(3)一定为数字或者是在cint之前检查一下是否为数字型,可以用IsNumeric再加一些其它的判断
shengjr 2003-11-17
  • 打赏
  • 举报
回复
都被你response.end了怎么还会有错误提示呢!
vivisogood 2003-11-17
  • 打赏
  • 举报
回复
把 cint 改成 cdbl 试试。
panjisheng 2003-11-17
  • 打赏
  • 举报
回复
感谢!Tal(Tal) 成功解决!!
ljupin 2003-11-16
  • 打赏
  • 举报
回复
有时候真累:)
昨天在动网论坛也看到这么一个问题
skyarrow 2003-11-16
  • 打赏
  • 举报
回复
楼主的cint()的变量肯定不是数字,楼主好好检查一下,把每个变量都打出来
zcwmxn 2003-11-16
  • 打赏
  • 举报
回复
你确认cint(a)中的a 是一个整数?
nchen123 2003-11-16
  • 打赏
  • 举报
回复
还有这里:


response.write birthuser(1)
nchen123 2003-11-16
  • 打赏
  • 举报
回复
我不是让你看看 cint 里面是什么的吗? 如果不是数字的话,会出错的


response.write wsetup(3)
panjisheng 2003-11-16
  • 打赏
  • 举报
回复
inelm(Archimond) 的方法不行!



Microsoft VBScript 运行时错误 错误 '800a000d'

类型不匹配: 'Clng'

/club2/forum.asp,行234
panjisheng 2003-11-16
  • 打赏
  • 举报
回复
'=========生日显示开始================
if cint(wsetup(3))=1 then
myCache.name="userbirthday"
if myCache.valid then
response.write myCache.value
'mycache.makeEmpty
else
dim age
dim birthuser
dim foundbirth
dim showbirthday
dim birthNum,birthday
foundbirth=false
birthNum=0
on error resume next
sql="select birthuser from config where active=1"
set rs=conn.execute(sql)
if not isnull(rs(0)) or rs(0)<>"" then
birthuser=split(rs(0),"$")
if ubound(birthuser)<3 then
foundbirth=false
elseif cint(birthuser(1))<>0 then
foundbirth=true
elseif datediff("d",birthuser(2),Now())>0 then
foundbirth=false
else
foundbirth=true
end if
else
foundbirth=false
end if
if not foundbirth then
set rs=conn.execute("select username,birthday from [user] where birthday<>'' order by userid")
do while not rs.eof
if isdate(rs(1)) then
if month(rs(1))=month(Now()) and day(rs(1))=day(Now()) then
age=datediff("yyyy",rs(1),Now())
birthday=birthday & "<a href=dispuser.asp?name="&rs(0)&" title=祝"&age&"岁生日快乐! target=_blank>〖祝 "&rs(0)&" 生日快乐<img src=pic/birthday00.gif align=absmiddle border=0>〗 </a> ,"
birthNum=birthNum+1
end if
end if
rs.movenext
loop
rs.close
set rs=nothing
if birthday="" then birthday="今天没有朋友过生日..."
conn.execute("update config set birthuser='" & birthday & "$" & birthNum & "$" & Now() & "' where active=1")
else
birthday=birthuser(0)
birthNum=birthuser(1)
end if
showbirthday="<BR><table cellpadding=3 cellspacing=1 align=center class=tableborder1><TR ><Th align=left >≡ 今天过生日的用户(共 "&birthNum&" 人)≡</Th></TR><TR><TD width=100% vAlign=middle class=tablebody1 >"&birthday&"</TD></TR></table>"
myCache.add showbirthday,date+1
end if
end if
'=========生日显示结束================
tuoshi 2003-11-16
  • 打赏
  • 举报
回复
贴代码上来啊,呵呵,估计应该和Inelm说的一样,类型不匹配或值为空,也有可能是值超出了整数范围。。。
kanshangren 2003-11-16
  • 打赏
  • 举报
回复
给点源码呀
nchen123 2003-11-16
  • 打赏
  • 举报
回复
把出错的那一行 代码贴出来,
一般是 cint 函数的参数值为空, 或者是字符型造成的。
比如:
cint(a)

那么你在这一句前面加上
response.write "<br>a=" & a
response.end

看看到底是什么值。

或者把 cint 改成 clng 试试。

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧