ASP VB代码求助
<!--#includefile="ConnStrings.asp"--><%DimRs1,Rs2,Rs3,Rs4DimSchoolName,GP1,GP2,GP3Con...
<!--#include file="ConnStrings.asp"-->
<%
Dim Rs1,Rs2,Rs3,Rs4
Dim SchoolName,GP1,GP2,GP3
ConnOpen
Set MyCmd = Server.CreateObject("ADODB.Command")
MyCmd.ActiveConnection = MyConn
MyCmd.CommandText = "SELECT UserName FROM FT_User WHERE depname=学院"
Set Rs1 = MyCmd.Execute
While not rs1.eof
SchoolName = Rs1("UserName")
Response.write SchoolName&" "
GP1 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (typeid=20)"
Set Rs2 = MyCmd.Execute
While not rs2.eof
GP1 = GP1 + 1
rs2.movenext
Wend
Response.write "基层信息"&GP1&" "
Rs2.close
set Rs2=nothing
GP2 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (goodnews=1)"
Set Rs3 = MyCmd.Execute
While not rs3.eof
GP2 = GP2 + 1
rs3.movenext
Wend
Response.write "推荐新闻"&GP2&" "
Rs3.close
set Rs3=nothing
GP3 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (click>50)"
Set Rs4 = MyCmd.Execute
While not rs3.eof
GP3 = GP3 + 1
rs4.movenext
Wend
Response.write "点击超50"&GP3&" "
Rs4.close
set Rs4=nothing
GP = GP1+GP2+GP3
response.write "总分"&GP&"<br>"
rs1.movenext
Wend
Rs1.close
set Rs1=nothing
ConnClose
%>
这段代码是一个年度发帖评比的代码
运行提示500错误
同时我还想加入确定发稿时间为2007年,怎么处理?
错误原因是对字符串没加''
后来自己检查出来了
问题变为怎么确定发稿时间为2007年,数据库中有一个字段存放发帖的详细时间,可以假设为NEWS组里面的TIME.
谢谢 展开
<%
Dim Rs1,Rs2,Rs3,Rs4
Dim SchoolName,GP1,GP2,GP3
ConnOpen
Set MyCmd = Server.CreateObject("ADODB.Command")
MyCmd.ActiveConnection = MyConn
MyCmd.CommandText = "SELECT UserName FROM FT_User WHERE depname=学院"
Set Rs1 = MyCmd.Execute
While not rs1.eof
SchoolName = Rs1("UserName")
Response.write SchoolName&" "
GP1 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (typeid=20)"
Set Rs2 = MyCmd.Execute
While not rs2.eof
GP1 = GP1 + 1
rs2.movenext
Wend
Response.write "基层信息"&GP1&" "
Rs2.close
set Rs2=nothing
GP2 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (goodnews=1)"
Set Rs3 = MyCmd.Execute
While not rs3.eof
GP2 = GP2 + 1
rs3.movenext
Wend
Response.write "推荐新闻"&GP2&" "
Rs3.close
set Rs3=nothing
GP3 = 0
MyCmd.CommandText = "SELECT * FROM News WHERE (checked=1) AND (editor="&SchoolName&") AND (click>50)"
Set Rs4 = MyCmd.Execute
While not rs3.eof
GP3 = GP3 + 1
rs4.movenext
Wend
Response.write "点击超50"&GP3&" "
Rs4.close
set Rs4=nothing
GP = GP1+GP2+GP3
response.write "总分"&GP&"<br>"
rs1.movenext
Wend
Rs1.close
set Rs1=nothing
ConnClose
%>
这段代码是一个年度发帖评比的代码
运行提示500错误
同时我还想加入确定发稿时间为2007年,怎么处理?
错误原因是对字符串没加''
后来自己检查出来了
问题变为怎么确定发稿时间为2007年,数据库中有一个字段存放发帖的详细时间,可以假设为NEWS组里面的TIME.
谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询