Microsoft JET Database Engine (0x80040E14) from 子句语法错误

来源:百度知道 编辑:UC知道 时间:2024/06/22 17:36:53
Microsoft JET Database Engine (0x80040E14)
FROM 子句语法错误。
/admin.asp, 第 25 行
源文件如下:

</head>
<body>
<!--#include file="include/top.htm"-->
<!--#include file="include/conn.asp"-->
<%
dim user,password,sal
user=request.form("user")
password=request.Form("password")
if user<>"" and password<>"" then
sql="select * from user where user='" &user& "' and pass_word='" &pass_word& "'"
rs.open sql,conn,1,3
if not rs.eof then
response.Redirect "index1.asp"
else
%>
<script>
alert("你输入的用户名或密码不正确!")
location.href="admin.asp"
</script>
<%end if
else
%>
<table width="763" align="center" border="1" cellpadding="0" bordercolor="#0

可能是这句的问题:

sql="select * from user where user='" &user& "' and pass_word='" &pass_word& "'"

你改成下面这样试一下,因为USER是SQL关键字。

sql="select * from [user] where [user]='" &user& "' and pass_word='" &pass_word& "'"