马卡龙色系搭配:ASP高手救命~~```帮我看看哪里错了 我想拜师 加我QQ43433268

来源:百度文库 编辑:高校问答 时间:2024/04/29 19:45:53
错误类型:
(0x80020009)
发生意外。
/counter/inc/count.asp, 第 21 行
count.asp代码如下:
<%
dim conn,strconn
dim totalHit,weekHit,dayHit
dim totalHitMsg,weekHitMsg,dayHitMsg
Set conn = Server.CreateObject("ADODB.Connection")
strconn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("data/db.mdb")
conn.Open Strconn
addCount()
getCount()
totalHitMsg=setImgCount(totalHit)
weekHitMsg=setImgCount(weekHit)
dayHitMsg=setImgCount(dayHit)
conn.close
set conn=nothing

function addCount()
dim rs,sql
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from tb_count"
rs.open sql,conn,1,3
rs("totalHit")=rs("totalHit")+1
if DateDiff("d",rs("lastWeekDt"),now)>7 then
rs("weekHit")=1
rs("lastWeekDt")=now()
else
rs("weekHit")=rs("weekHit")+1
end if
if DateDiff("d",rs("lastDt"),now)>1 then
rs("dayHit")=1
else
rs("dayHit")=rs("dayHit")+1
end if
rs("lastDt")=now()
rs.update
rs.close
set rs=nothing
end function

function getCount()
dim rs,sql
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from tb_count"
rs.open sql,conn,1,1
totalHit=rs("totalHit")
weekHit=rs("weekHit")
dayHit=rs("dayHit")
rs.close
set rs=nothing
end function

function setImgCount(counter)
dim countLen,imgMsg
imgMsg=""
countLen=len(counter)
for i=1 to countlen
imgMsg=imgMsg&"<img src='images/counter/"&mid(counter,i,1)&".gif'></img>"
next
setImgCount=imgMsg
end function
%>

21行改成
rs.open sql,conn,3,2
或者
rs.open sql,conn,1,1
试一试

rs("totalHit")=rs("totalHit")+1

这行出错??