16螺纹钢理论重量表:我的数据库修改怎么有错误?大家帮帮忙!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 19:40:55
读取表单
<!--#include file="conn.asp" -->
<%
id1=request("id")
if id1="" then Response.Redirect "index.asp"
%>
<html>
<HEAD>
<title>modifydisplay</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></HEAD>
<BODY>
<div>
<%
sql="select * from employee where id="+id1
rs.open sql,conn,1,1
if rs.EOF then
Response.Write "数据库中暂无资料!"
else
%>
</div>
<table width="768" border="0" cellpadding="0" cellspacing="0">
<tr> </tr>
<tr>
<td height="25" colspan=8><a href="index.asp">首页</a> <a href="add.asp">添加</a> <a href="del.asp">删除</a></td>
</tr>
<tr> </tr>
</table>
<table width="768" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" cellpadding="0" cellspacing="0">
<form action="updata.asp?id=<%=rs("id")%>" method=post name=form1>
<tr>
<td height="12"> 歌名:</td>
<td>
<input name=text1 value=<%=rs("name")%>>
</td>
</tr>
<tr>
<td height="17">路径:</td>
<td><input name=text2 id="text2" value=<%=rs("url")%> size="100"></td>
</tr>
<tr>
<td height="25" colspan="2"> <input type="submit" value="提 交" id=submit1 name=submit1></td>
</form>
</table></td>
</tr>
</table>
<div>
<%
end if
%>
</div>
</BODY>
</HTML>
修改数据
<!--#include file="conn.asp" -->
<%
id1=request("id")
if request("text1")="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('请输入用户名!');" & "history.back()" & "</script>"
Response.End
end if

name=request("text1")
url=request("text2")

sql="update employee set name='"&name&"',url='"&url&"' where id="+id1
rs.Open sql,conn,1,1

response.write "<script language=JavaScript>" & chr(13) & "alert('记录信息修改成功!');"&"window.location.href = 'show.asp'"&" </script>"
set rs=nothing
%>
数据库没错,大家看看这些代码有什么错误?