<!--#include file="dataconn.asp"-->
<%
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
response.write "对不起,还没有该次工资!"
response.end
end if
totalput=rs.RecordCount
if rs.eOF then
Response.Write escape("<font color=#ff0000>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</font>")
response.end
end if
<%
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
response.write "对不起,还没有该次工资!"
response.end
end if
totalput=rs.RecordCount
if rs.eOF then
Response.Write escape("<font color=#ff0000>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</font>")
response.end
end if
<%
xh=trim(request.querystring("xh")) '获取表单传过来的XH的值,trim去掉空字符串
stuname=trim(request.querystring("stuname"))
team=trim(request.querystring("team"))
set rs=conn.execute("select cxsetup from cominfo")'调用execute方法查询记录,不过我记得ASP在查询时一般也用OPEN的
cxsetup=rs("cxsetup").value '把查出cxsetup的值取出来
rs.close '关闭记录集
set rs=nothing '销毁rs对象
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
response.write "对不起,还没有该次工资!" '在浏览器输出此语句
response.end '程序结束执行
end if
totalput=rs.RecordCount '取总记录数量
if rs.eOF then '如果到达记录尾则表示没有记录
Response.Write escape("<font color=#ff0000>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</font>")
response.end
end if
解释ASP?不知道能否满足你要求
<%
xh=trim(request.querystring("xh")) '获取表单传过来的XH的值,trim去掉空字符串
stuname=trim(request.querystring("stuname"))
team=trim(request.querystring("team"))
set rs=conn.execute("select cxsetup from cominfo")'调用execute方法查询记录,不过我记得ASP在查询时一般也用OPEN的
cxsetup=rs("cxsetup").value '把查出cxsetup的值取出来
rs.close '关闭记录集
set rs=nothing '销毁rs对象
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
response.write "对不起,还没有该次工资!" '在浏览器输出此语句
response.end '程序结束执行
end if
totalput=rs.RecordCount '取总记录数量
if rs.eOF then '如果到达记录尾则表示没有记录
Response.Write escape("<font color=#ff0000>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</font>")
response.end
end if
这么历害呀,少看你了呀
3. sql="select * from studentpmb where stuidh='"&xh&"' and stuname='"&stuname&"'"
rs.open sql,conn,1,1 '应该是这种方式才是正确的,第一个参数为你的Sql语句,第二个参数为数据库联接对象,后面的两个参数记得是设置是否只读与移动游标,Vbs参数我习惯不加括号呵4. sql = "insert into note (FromUser,ToUser,MessageTitle,Message) values ('xxx','"&username&"','xxx!','xxx!')"
conn.execute(sql)'这个只是用于操作增,删,改的无记录集返回的SQL语句,open用于有返回的记录集方式,所以不管怎么使用你都没有结果集返回来。5.补充下:response.end '并把缓存输出到浏览器,然后程序结束执行.6.Response.Write escape("<font color=#ff0000>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</font>")以CSS实现比较好些<span style='color:##ff0000'>对不起,没有查询到该记录,请检查你输入的密码、姓名和查询项目是否对应!</span>建议先学习下CSS和基础的东东先