日期:2014-05-17  浏览次数:20871 次

求高手注释以下代码,先谢了
xh=trim(request.querystring("xh"))
stuname=trim(request.querystring("stuname"))
team=trim(request.querystring("team"))
set rs=conn.execute("select cxsetup from cominfo")
cxsetup=rs("cxsetup").value
rs.close
set rs=nothing  
if team="all" then 
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"'"
team="当前时段所有项目"
else
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"' and ksname='"&team&"'"
end if
on error resume next
set rs=conn.execute(sql)
if err then

------解决方案--------------------
xh=trim(request.querystring("xh"))'获取URL中xh参数的值,并赋值给变量xh
结帖太低。。。
------解决方案--------------------
VB code

xh=trim(request.querystring("xh"))//去掉传过来的值的首尾空格
stuname=trim(request.querystring("stuname"))//同上
team=trim(request.querystring("team"))
set rs=conn.execute("select cxsetup from cominfo")//执行数据查询,查询cxsetup
cxsetup=rs("cxsetup").value//获取从数据库查询出来的cxsetup字段值
rs.close//关闭数据库
set rs=nothing   //清空数据集
if team="all" then  //判断传过来的team是不是等于all字符串,如果等于all
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"'"//根据xh、stuname查询数据
team="当前时段所有项目"
else//若果不等于all,拼接如下sql
sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"' and ksname='"&team&"'"
end if
on error resume next
set rs=conn.execute(sql)//执行查询
if err then