平利绞股蓝哪个牌子好:asp程序小问题

来源:百度文库 编辑:高考问答 时间:2024/04/28 00:42:34
<%
if request("action")="queren" then
username=trim(request.Form("username"))
pass=trim(request.Form("password"))
if username="" then
response.write "<script>alert('对不起,请输入完整的用户名');history.go(-1);</script>"
else
if pass="" then
response.write "<script>alert('对不起,请输入完整的密码');history.go(-1);</script>"
else
set rs = server.createobject("adodb.recordset")
sql="select id from user where username="&username&" and password="&pass
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write "<script>alert('对不起,您的用户名或密码不符,请重新确认');window.close();</script>"
......

set conn = nothing
end if
end if
end if
end if
%>
大致内容如上,无论怎么调试,总是显示sql语句中"至少一个参数没有被指定值"。望高手指教

sql="select id from user where username='"&username&"' and password='"&pass&"'"
字符字段需要添加单引号

sql="select id from user where username="&username&"

把你的数据库表名user改为users(sql句中也改)或别的名字看看~