注册 登录
编程论坛 WEB前端(UI)

求中段代码的详细说明

adweset 发布于 2009-08-31 01:50, 737 次点击
sql="select * from SoftDown_SoftInfo where SoftID="&SoftID
 rs.open sql,conn,1,1
 DayDate=trim(rs("DayDate"))
 WeekDate=trim(rs("WeekDate"))
 MonthDate=trim(rs("MonthDate"))
 AllHits=trim(rs("AllHits"))
 avgGrade=trim(rs("avgGrade"))
 Points=rs("Points")
 '更新软件下载次数
 sql="update SoftDown_SoftLink set Hits=Hits+1 where Id=" & cstr(request.QueryString("ID"))
 conn.execute sql
 sql="update SoftDown_SoftInfo set AllHits=AllHits+1,DayHits=DayHits+1,WeekHits=WeekHits+1,MonthHits=Monthhits+1 where SoftId=" & SoftID
 conn.execute sql

 if datediff("H",DayDate,Now)>=24 then
 sql="update SoftDown_SoftInfo set DayDate=Now(),DayHits=1 where SoftId=" & SoftID
 conn.execute sql      
 end if

 if datediff("D",WeekDate,Now)>=7 then
 sql="update SoftDown_SoftInfo set WeekDate=Now(),WeekHits=1 where SoftId=" & SoftID
 conn.execute sql
 end if

 if datediff("D",MonthDate,Now)>=31 then
 sql="update SoftDown_SoftInfo set MonthDate=Now(),MonthHits=1 where SoftId=" & SoftID
    conn.execute sql
 end if

 rs.close
2 回复
#2
lengchuan2009-09-06 16:52
上面代码中涉及到的类有的看不到它的定义的呀,要结合这些类的定义来读的~
#3
aspic2009-09-13 09:13
程序代码:
sql="select * from SoftDown_SoftInfo where SoftID="&SoftID
rs.open sql,conn,1,1
'下面是赋值给变量 下面用到
DayDate=trim(rs("DayDate"))
WeekDate=trim(rs("WeekDate"))
MonthDate=trim(rs("MonthDate"))
AllHits=trim(rs("AllHits"))
avgGrade=trim(rs("avgGrade"))
Points=rs("Points")

'更新软件下载次数
sql="update SoftDown_SoftLink set Hits=Hits+1 where Id=" & cstr(request.QueryString("ID"))
conn.execute sql
'更新浏览或者点击次数(原来基础上+1)

sql="update SoftDown_SoftInfo set AllHits=AllHits+1,DayHits=DayHits+1,WeekHits=WeekHits+1,MonthHits=Monthhits+1 where SoftId=" & SoftID
conn.execute sql
'更新总点击量 当日点击量 周点击量 月点击量(原来基础上+1)

if datediff("H",DayDate,Now)>=24 then
sql="update SoftDown_SoftInfo set DayDate=Now(),DayHits=1 where SoftId=" & SoftID
conn.execute sql      
end if
'更新记录日期不是当前日期软件信息表的记录 设置日期为当前时间 日点击量+1 条件为
'以下类似 周/月
if datediff("D",WeekDate,Now)>=7 then
sql="update SoftDown_SoftInfo set WeekDate=Now(),WeekHits=1 where SoftId=" & SoftID
conn.execute sql
end if

if datediff("D",MonthDate,Now)>=31 then
sql="update SoftDown_SoftInfo set MonthDate=Now(),MonthHits=1 where SoftId=" & SoftID
    conn.execute sql
end if

rs.close
1