[求助] 错误代码 0x80040E14
以下是登录表单,<form action="user_login.asp" method="post" name="login" id="login">
<tr>
<td height="20" align="right" class="title">用户名:</td>
<td height="20" align="left"><input name="user_id" type="text" id="user_id" size="12" maxlength="50" /></td>
</tr>
<tr>
<td height="10" align="right" class="title">密码:</td>
<td height="10" align="left"><input name="password" type="password" id="password" size="12" maxlength="50" /></td>
</tr>
<tr>
<td height="20" colspan="2" align="center" valign="middle" class="title"><label>
<input type="submit" name="button" id="button" value="提交">
</label>
<a href="../bbs/register.asp">注册</a></td>
</tr>
</form>
以下是户名登录验证.
<%
Dim db
set db=server.createobject("Adodb.Connection")
db.open "Dbq=" & server.mappath("../data/data.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
'查看有无该用户
strSql="Select user_id,user_type,sex,Join_id,id From users"
strSql=strSql & " Where user_id='" & Request.Form("user_id") & "' And password='" & Request.Form("password") & "'"
Set rs=db.Execute(strSql)
If not rs.eof and not rs.bof Then
'如果有记录,表示有该用户,则将用户名和用户类型保存到Session中
Session("user_id")=rs("user_id")
Session("user_type")=rs("user_type")
Session("sex")=rs("sex")
Session("Join_id")=rs("Join_id")
Session("id")=rs("id")
'如果是普通用户,重定向到首页;如果是管理员,重定向到管理员页面
If Session("user_type") = "A" Then
Response.Redirect "../admin/manage.asp"
ELse
Response.Redirect "index.asp"
End If
Else
'如果没有记录,表示没有该用户,请给出提示信息
Response.Write "对不起,用户名或密码有误,请<a href='index.asp'>返回首页</a>重新登录"
End If
%>
以下是修改用户名表单
<%
dim conn
set conn = Server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("../data/data.mdb")
%>
<%
set res=server.CreateObject("adodb.recordset")
sql="Select * From users Where user_id='" & session("user_id") & "'"
res.open sql,conn,1,1
if not res.eof then %>
<form action="updateok.asp?id=<%=res("id")%>" name="myform" method="post"> <tr>
<td height="30" colspan="4" align="center" valign="middle" bgcolor="#00FFFF">修改信息 您是00<%=res("id")%>号会员</td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">用户名:</td>
<td height="30" colspan="3" align="left" valign="middle" bgcolor="#00FFFF"> <input name="<%=res("user_id")%>" type="text" id="<%=res("user_id")%>" value="<%=res("user_id")%>"></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">真实姓名:</td>
<td height="30" colspan="3" align="left" valign="middle" bgcolor="#00FFFF"> <input name="<%=res("realname")%>" type="text" id="<%=res("realname")%>" value="<%=res("realname")%>">
<input type="radio" name="sex" value="先生" <%If res("sex")="先生" Then Response.Write "checked" %>>
先生
<input type="radio" name="sex" value="女士" <%If res("sex")="女士" Then Response.Write "checked" %>>
女士</td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">个人简介:</td>
<td height="95" colspan="3" align="left" valign="middle" bgcolor="#00FFFF"> <textarea name="<%=res("intro")%>" id="<%=res("intro")%>" cols="45" rows="5"><%=res("intro")%></textarea></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">公司简介:</td>
<td height="125" colspan="3" align="left" valign="middle" bgcolor="#00FFFF"> <textarea name="<%=res("company_name")%>" id="<%=res("company_name")%>" cols="80" rows="8"><%=res("company_name")%></textarea></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">公司地址:</td>
<td height="30" colspan="3" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="company_add" value="<%=res("company_add")%>"></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">邮政编码:</td>
<td width="200" height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="company_zip" value="<%=res("company_zip")%>"></td>
<td width="100" height="30" align="right" valign="middle" bgcolor="#00FFFF">手机:</td>
<td width="200" height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="Mobile" value="<%=res("Mobile")%>"></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">公司电话:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="company_tel" value="<%=res("company_tel")%>"></td>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">公司传真:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="company_fax" value="<%=res("company_fax")%>"></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">E-mail:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="email" value="<%=res("email")%>"></td>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">OICQ:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <input type="text" size="25" name="OICQ" value="<%=res("OICQ")%>"></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">盟商:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <%if res("Join_id")=0 then%>您还没有加盟<%else%>您已加盟<%End if%></td>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">管理:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <%if res("user_type")="A" then%>您为管理员<%else%>您不是管理员<%end if%></td>
</tr>
<tr>
<td width="100" height="30" align="right" valign="middle" bgcolor="#00FFFF">发表文章:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <%=res("article")%>篇</td>
<td height="30" align="right" valign="middle" bgcolor="#00FFFF">回复文章:</td>
<td height="30" align="left" valign="middle" bgcolor="#00FFFF"> <%=res("rearticle")%>篇</td>
</tr>
<tr>
<td height="30" colspan="4" align="center" valign="middle" bgcolor="#00FFFF">
<input type="submit" value=" 确 定 " name="submit" class="inputbutton"></td>
</tr></form>
以下是修改用户资料提交页面:
<%@ LANGUAGE = VBScript CodePage = 936 LCID=2052%>
<%
dim conn
set conn = Server.CreateObject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("../data/data.mdb")
%>
<%
dim realname,sex,intro,company_name,company_add,company_zip,company_tel,company_fax,email,oicq
realname=Replace(Request.Form("realname"),"'","''")
sex=Replace(Request.Form("sex"),"'","''")
intro=Replace(Request.Form("intro"),"'","''")
company_name=Replace(Request.Form("company_name"),"'","''")
company_add=Replace(Request.Form("company_add"),"'","''")
company_zip=Replace(Request.Form("company_zip"),"'","''")
company_tel=Replace(Request.Form("company_tel"),"'","''")
company_fax=Replace(Request.Form("company_fax"),"'","''")
email=Replace(Request.Form("email"),"'","''")
oicq=Replace(Request.Form("oicq"),"'","''")
sql3="Update users set id='"& id &"' where ID="&Request.Form("id")
conn.execute (sql3) '这是第16行
response.redirect("../Product/index.asp")
%>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'ID=' 中。
/admin/updateok.asp, 第 16 行
[ 本帖最后由 虫子世界 于 2009-11-10 10:45 编辑 ]