xuehoo688 2003-12-23 04:25:10
我用的是动网6.0不知道为什么,我运行的时候老实出现这个问题

Microsoft VBScript 运行时错误 错误 '800a0009'
下标越界: '[number: 2]'
/index.asp,行90

代码为
<%
sql="select top 1 TopicNum,BbsNum,TodayNum,UserNum,lastUser,yesterdaynum,maxpostnum,maxpostdate,LastPost from config where active=1"
set rs=conn.execute(sql)
LastPostInfo=split(rs("LastPost"),"$")
if not isdate(LastPostInfo(2)) then LastPostInfo(2)=Now()
LastPostTime=LastPostInfo(2)//---------是第九十行
if datediff("d",LastPostTime,Now())>0 and ubound(LastPostInfo)=7 then
conn.execute("update config set yesterdaynum=todaynum,LastPost='"&checkStr(LastPostInfo(0))&"$"&checkStr(LastPostInfo(1))&"$"&Now()&"$"&checkStr(LastPostInfo(3))&"$"&checkStr(LastPostInfo(4))&"$"&checkStr(LastPostInfo(5))&"$"&checkStr(LastPostInfo(6))&"$"&checkStr(LastPostInfo(7))&"'")
conn.execute("update config set todaynum=0")
end if
if rs(2)>rs(6) then conn.execute("update config set maxpostnum=todaynum,maxpostdate=Now()")
%>
...全文
50 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuehoo688 2003-12-24
  • 打赏
  • 举报
回复
不可以的呀!!我招你的试了一下!!谢谢
matildafu 2003-12-23
  • 打赏
  • 举报
回复
LastPostInfo=split(rs("LastPost"),"$") 字符串分割,返回基于 0 的一维数组,判断数组的长度。
dim Flag
Flag=false
for i=0 to UBound(LastPostInfo)
if(i=2) then
Flag = true
end if
next
if(Flag) then
if not isdate(LastPostInfo(2)) then LastPostInfo(2)=Now()
LastPostTime=LastPostInfo(2)//---------是第九十行
end if

28,407

社区成员

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

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