做个肠镜检查多少钱:asp问题.急.....

来源:百度文库 编辑:神马品牌网 时间:2024/05/08 01:53:55
<!-- #include file="conn.asp"-->
<%dim username
dim userpsw
username=request("username")
userpsw=request("userpsw")
rs.open"select * from user where username='"&username&"'",cn,1
if not rs.eof and not rs.bof then
if userpsw=rs("userpsw") then
session("user")=true
session("username")=username
response.redirect("index.asp")
end if
end if
rs.close
set rs=nothing
cn.close
set cn=nothing
%> 那位高手帮忙看看,怎么会得到个from子句语法错误.谢了.
不行不行不行....重定向不了啊...我哭!~!~1

rs.open "select * from user where username="&username,cn,1 ,1

rs.open"select * from user where username='"&username&"'",cn,1 ,1

此改成这样就行了

rs.open "select * from [user] where u[sername]='"&username&"'",cn,1

user 是SQL的保留字,对于保留字要加上[ ]的,例如表名或字段名为ADD就应改为[ADD],

rs.open "select * from [user] where [username]='"&username&"'",cn,1,1

rs.open "select * from [user] where username='"&username&"'",cn,1