继续求解:关于数据修改的问题
大家好,俺遇到了如下问题,请帮忙看看.谢谢
有一个数据表,里面有如下字段:id,name,password,quanx.
用ASP写了用户浏览页面index.asp,可以浏览所有用户的名字,密码和权限
当点击用户的名字时,就可以连接到修改用户的资料的页面.遇到如下问题
----------------------------------------------------
在更新的时候,我添加了如下代码,但是数据还是没有更新到
但又提示更新成功.不知道到底是什么原因.救我啊.兄弟们!!!
----数据修改页面----
<%
Dim edit_id,edit_sql
edit_id= Request.QueryString("id")
Set edit_sql=conn.execute("Select * From yongh Where ID = " & edit_id)
%>
<form name="form1" method="post" action="admin_editd.asp">
<table width="253" border="1" cellpadding="0" cellspacing="0">
<tr>
<th width="69" scope="col"><div align="center">用户名</div></th>
<th width="178" scope="col">
<div align="left">
<input name="name" type=text value="<%=Trim(edit_sql("name"))%>" maxlength="10">
</div></th>
<td><div align="center">密码 </div></td>
<input name="password" type="text" value="<%=Trim(edit_sql("password"))%>" maxlength="10">
<td><div align="center">权限</div></td>
<div align="left">
<select name="quanx">
<%Select Case edit_sql("quanx")
Case 0
Response.write("<option value=0>管理员</option>")
Case 1
Response.write("<option value=0>总办</option>")
Case 2
Response.write("<option value=0>工艺部</option>")
Case 3
Response.write("<option value=0>设计部</option>")
End Select%>
<option value=0>管理员</option>
<option value=1>总办</option>
<option value=2>工艺部</option>
<option value=3>设计部</option>
</select>
-------更新页面----
<body>
<%
Dim editd_rs,editd_sql
dim editd_id
editd_id= Request.form("id")
editd_sql= "Select * From yongh Where ID="&editd_id
Set editd_rs=Server.CreateObject("ADODB.Recordset")
editd_rs.open editd_sql,conn,2,3
%>
<%
If Request("name")="" Or Request("Password")="" then
%>
<script language="javascript">
alert("用户名或密码栏必须填写")
history.go(-1)
</script>
<% else
editd_rs("id")=editd_id
editd_rs("name")=request("name")
editd_rs("password")=request("password")
editd_rs("quanx")=request("quanx")
editd_rs.Update
%>
<script language="javascript">
alert("修改完成")
location.href="admin_del.asp"
</script>
<%
End If
conn.close
editd_rs.close
set conn=nothing
set editd_rs=nothing
%>
</body>
</html>