关于查询select
有db1.dob(user,admin)数据库,表user(user_id,user_name,user_pwd)里面有数据01,aaaa,12345conn(连接文件)
表单中输入用户名:aaaa
密 码:12345
exec="select * from user where user_name='"&trim(request.Form("name"))&"'"
rs.open exec,conn,1,1
if rs("user_name")<>trim(request.Form("name")) then'以下正确
response.write("<script language=vbscript>"&"msgbox"&"""你输入的员工帐号不存在,请重输!"""&"</script>")
response.write("<script>history.go(-1)</script>")
elseif rs("user_pwd")<>trim(request.Form("password")) then'以下正确
response.write("<script language=vbscript>"&"msgbox"&"""你输入的密码错误,请重输!"""&"</script>")
response.write("<script>history.go(-1)</script>")
elseif trim(request.form("yzm"))<>trim(cstr(session("yzm_no"))) then
response.write(session("yzm_no"))
response.write("<script language=vbscript>"&"msgbox"&"""你输入的验证码错误,请重输!"""&"</script>")
response.write("<script>history.go(-1)</script>")
else
session("adminname")=request.form("name")
session("admin")="OK"
response.write("<script language=vbscript>"&"msgbox"&"""欢迎您!管理员!请正确操作!"""&"</script>")
if session("adminname")="admin" then
response.write(session("adminname")&" 欢迎您进来管理!")
end if
end if
这里判断不出用户名说,怎么回事。