当我提交"更改" 相关图片 系统提示错误信息"Microsoft JET Database Engine 错误 '80040e14' UPDATA 语句的语法错误。 /asp/userinf.asp" 原程序" <!--#include file="sqlstr.asp"--> <!--#include file="opendb.asp"--> <% sub userinf(href) oabusyusername=request.cookies("oabusyusername") oabusyuserdept=request.cookies("oabusyuserdept") oabusyuserlevel=request.cookies("oabusyuserlevel")
if request("submit")="更改" then password=request("password") name=request("name") 'name=request.cookies("oabusyusername") set conn=opendb("oabusy","conn","accessdsn") set rs=server.createobject("adodb.recordset") sql = "update userinf set " sql = sql & "password=" & SqlStr(password) & ", " sql = sql & "name=" & SqlStr(name) & " where username=" & sqlstr(oabusyusername) conn.Execute sql %> <br><br> <font color=red>用户资料维护成功!</font> <% else %>
<script Language="JavaScript"> function maxlength(str,minl,maxl) { if(str.length <= maxl && str.length >= minl){return true;}else{return false;} }
function form_check(){
var l2=maxlength(document.form2.password.value,1,20); if(!l2){window.alert("密码的长度大于1位小于20位");document.form2.password.focus();return (false);}
var a1=document.form2.password.value; var a2=document.form2.repassword.value; if(a1!=a2){window.alert("两次输入的密码应相同");document.form2.repassword.focus();return (false);}
var l3=maxlength(document.form2.name.value,1,20); if(!l3){window.alert("姓名的长度大于1位小于20位");document.form2.name.focus();return (false);}
}
</script>
<% set conn=opendb("oabusy","conn","accessdsn") set rs=server.createobject("adodb.recordset") sql="select * from userinf where username=" & sqlstr(oabusyusername) rs.open sql,conn,1 %> <br><br> <form action="<%=href%>" method=post name="form2" onsubmit="return form_check();"> <table border=1 borderColorDark=#ffffff borderColorLight=#336699 cellSpacing=0 cellpadding="5"> <tr> <td bgcolor="#3399CC"> <font color="#FFFFFF">用 户 名:</font><%=oabusyusername%> </td> </tr> <tr> <td bgcolor="#3399CC"> <font color="#FFFFFF">密 码:</font> <input type="password" name="password" size=20 value="<%=rs("password")%>"> </td> </tr> <tr> <td bgcolor="#3399CC"> <font color="#FFFFFF">密码确认:</font> <input type="password" name="repassword" size=20 value="<%=rs("password")%>"> </td> </tr> <tr> <td bgcolor="#3399CC"> <%if oabusyuserlevel="管理员" then %> <font color="#FFFFFF">姓 名:</font> <input type="text" name="name" size=20 value="<%=rs("name")%>"> <%else%> <font color="#FFFFFF">姓 名:</font><%=rs("name")%> <input type="Hidden" name="name" size=20 value="<%=rs("name")%>"> <%end if%> </td> </tr> <tr> <td bgcolor="#3399CC"> <font color="#FFFFFF">部 门:</font><%=oabusyuserdept%> </td> </tr> <tr> <td bgcolor="#3399CC"> <font color="#FFFFFF">职 位:</font><%=oabusyuserlevel%> </td> </tr> <tr> <td align=center> <input type="submit" name="submit" value="更改"> </td> </tr> </table> </form> <% end if end sub %> 还有就是登陆系统时会提示这个错误"ADODB.Field 错误 '80020009' BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,但应用程序要求操作的是当前的记录。" 相关原程序: <!--#include file="asp/keepformat.asp"--> <!--#include file="asp/opendb.asp"--> <!--#include file="asp/sqlstr.asp"--> <!--#include file="asp/bgsub.asp"--> <% oabusyusername=request.cookies("oabusyusername") %> <html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <link rel="stylesheet" href="css/css.css"> <title>企业办公系统</title> </head> <bgsound src="progctor.wav" loop="1"> <body bgcolor="#eeeeee" topmargin="5" leftmargin="5" onunload="opener.location.reload();">
<% if request("submit")="我已经看过" then id=request("id") set conn=opendb("oabusy","conn","accessdsn") sql="Insert into seesenddate (senddateid,username,havesee) values (" sql=sql & id & "," sql=sql & sqlstr(oabusyusername) & "," sql=sql & sqlstr("yes") & ")" conn.Execute sql %> <SCRIPT language=JavaScript> window.close(); opener.location.reload(); </script> </body> </html> <% response.end end if
%> <% call bghead() %> <% set conn=opendb("oabusy","conn","accessdsn") Set rs=Server.CreateObject("ADODB.recordset") sql="select * from senddate where id=" & request("id") rs.open sql,conn,1 %> <center> <b><%=rs("title")%></b> <br>[回复时间:<%=rs("inputdate")%>] [回复人所在部门: <% set conn=opendb("oabusy","conn","accessdsn") Set rs1=Server.CreateObject("ADODB.recordset") sql="select userdept,name from userinf where username=" & sqlstr(rs("sender")) rs1.open sql,conn,1 %> <%=rs1("userdept")%> ][回复者:<%=rs1("name")%>] </center> <% call bgmid() %> <br> <%=keepformat(rs("content"))%> <hr color=blue size=1> <center> <form method="post" name="form1" action="popredate.asp"> <input type="hidden" name="id" value="<%=rs("id")%>"> <input type="submit" name="submit" value="我已经看过"> </form> </center> <hr color=blue size=1> <% '打开数据库,显示id=rs("reid")的记录 set conn=opendb("oabusy","conn","accessdsn") Set rs2=Server.CreateObject("ADODB.recordset") sql="select * from senddate where id=" & rs("reid") rs2.open sql,conn,1 if not rs2.eof and not rs2.bof then %> <%=rs2("title")%> <% if rs2("filename")<>"" then %> --------附件:<a href="listsendfile.asp?id=<%=rs2("id")%>" target="_blank"><img src="images/attach.gif" width=30 height=30 border=0></a> <% end if %> <br> <%=keepformat(rs2("content"))%> <% end if call bgback() %> </body> </html>
[此贴子已经被作者于2005-1-12 19:03:37编辑过]