新微赢技术网
标题:
修改代码的错误在哪里????
[打印本页]
作者:
加非猫
时间:
2010-1-10 03:11
标题:
修改代码的错误在哪里????
点击修改之后页面就没反映了.地址显示转到了处理页面了....
这
是调出数据的页面.....
update_stu_xx.asp
<%
set conn=server.createobject("adodb.connection")
DSNtemp = "Driver={Microsoft Access Driver (*.mdb)};"
DSNtemp = DSNtemp & "DBQ=" & server.mappath("/swd/date/student.mdb")
conn.open DSNtemp
xuehao = request.querystring("id")
stext = "select * from stu where id=" &xuehao
set rs = conn.execute(stext)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>个人情况</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>?</p>
<div align="center">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bgcolor="#82BEF6">
<!--DWLayoutTable-->
<tr>
<td height="50" colspan="2" valign="top"><div align="center"><strong><font color="#000000" size="7" face="方正舒体, 方正姚体, ">个人情况登记表</font></strong></div></td>
</tr>
<tr>
<td width="2" height="4"></td>
<td width="985"></td>
</tr>
<tr>
<td height="295"></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<form id="form1" name="form1" method="post" action="update_stu_xx_save.asp?id=<%=rs("id") %>">
<tr>
<td width="518" height="227" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="100" height="21">
<div align="center"><strong>姓名</strong></div></td>
<td width="105" ><div align="center">
<input type="text" name="xingming" size="15" value="<%=(RS.Fields.Item("xingming").Value)%>">
</div></td>
<td width="190"><div align="center"><strong>担任职务</strong></div></td>
<td colspan="3" valign="top" ><div align="center">
<input type="text" name="zhiwu" size="15" value="<%=(RS.Fields.Item("zhiwu").Value)%>">
</div></td>
</tr>
<tr>
<td height="20"> <div align="center"><strong>出生年月</strong></div></td>
<td><div align="center">
<input type="text" name="chushengnianyue" size="15" value="<%=(RS.Fields.Item("chushengnianyue").Value)%>">
</div></td>
<td><div align="center"><strong>入伍时间</strong> </div></td>
<td width="105" ><div align="center">
<input type="text" name="ruwushijian" size="15" value="<%=(RS.Fields.Item("ruwushijian").Value)%>">
</div></td>
<td width="100" ><div align="center"><strong>政治面貌</strong> </div></td>
<td width="111" ><div align="center">
<input type="text" name="zhengzhimianmao" size="15" value="<%=(RS.Fields.Item("zhengzhimianmao").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>民族</strong></div></td>
<td ><div align="center">
<input type="text" name="minzu" size="15" value="<%=(RS.Fields.Item("minzu").Value)%>">
</div></td>
<td ><div align="center"><strong>入伍地区</strong> </div></td>
<td ><div align="center">
<input type="text" name="ruwudiqu" size="15" value="<%=(RS.Fields.Item("ruwudiqu").Value)%>">
</div></td>
<td ><div align="center"><strong>党团时间</strong> </div></td>
<td ><div align="center">
<input type="text" name="dangtuanshijian" size="15" value="<%=(RS.Fields.Item("dangtuanshijian").Value)%>">
</div></td>
<tr>
<td height="25" valign="top"><div align="center"><strong>文化程度</strong></div></td>
<td><div align="center">
<input type="text" name="wenhuachengdu" size="15" value="<%=(RS.Fields.Item("wenhuachengdu").Value)%>">
</div></td>
<td ><div align="center"><strong>籍贯</strong> </div></td>
<td ><div align="center">
<input type="text" name="jiguan" size="15" value="<%=(RS.Fields.Item("jiguan").Value)%>">
</div></td>
<td ><div align="center"><strong>邮政编码</strong> </div></td>
<td ><div align="center">
<input type="text" name="youzhengbianma" size="15" value="<%=(RS.Fields.Item("youzhengbianma").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>班级</strong></div></td>
<td><div align="center">
<input type="text" name="banji" size="15" value="<%=(RS.Fields.Item("banji").Value)%>">
</div></td>
<td ><div align="center"><strong>学号</strong> </div></td>
<td ><div align="center">
<input type="text" name="xuehao" size="15" value="<%=(RS.Fields.Item("xuehao").Value)%>">
</div></td>
<td><div align="center"><strong>电话号码</strong> </div></td>
<td ><div align="center">
<input type="text" name="lianxidianhua" size="15" value="<%=(RS.Fields.Item("lianxidianhua").Value)%>">
</div></td>
<tr>
<td height="20"> <div align="center"><strong>家庭住址</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="jiatingzhuzhi" size="60" value="<%=(RS.Fields.Item("jiatingzhuzhi").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>学习情况</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="xuexiqingkuang" size="60" value="<%=(RS.Fields.Item("xuexiqingkuang").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>个人奖励</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="gerenjiangli" size="60" value="<%=(RS.Fields.Item("gerenjiangli").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>违纪情况</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="weijiqingkuang" size="60" value="<%=(RS.Fields.Item("weijiqingkuang").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>个人评定</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="gerenpingding" size="60" value="<%=(RS.Fields.Item("gerenpingding").Value)%>">
</div></td>
<tr>
<td height="20"><div align="center"><strong>支部评定</strong></div></td>
<td colspan="5" valign="top" ><div align="center">
<input type="text" name="zhibupingding" size="60" value="<%=(RS.Fields.Item("zhibupingding").Value)%>">
</div></td>
</table></td>
<td width="448" border="1" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="447" border="1" height="264" valign="top" >
<%if rs("zhaopian")<>"" then%>
<p><a href="<%=rs("zhaopian")%>" target="_blank">
<%end if%>
<img src="<%if rs("zhaopian")="" then%>images/tupian.gif<%end if%><%if rs("zhaopian")<>"" then%><%=rs("zhaopian")%><%end if%>" name="img" width="443" height="277" border="0" id="img" />
</a> </p>
</td>
</tr>
<tr><td><input type="button" name="Submit232" value="相片上传" onClick="javascript:window.open('upload123.asp','窗口名称', 'height=300,width=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');" style="width:60;background-color: #FFCC66; color: #000000; border: 1 solid #000000" class="button" /></td></tr>
</table></td>
</tr>
<tr>
<td height="37"><div align="center">
<input type="submit" name="Submit" value="修改">
</div></td>
<td></td>
</tr></form>
<tr>
<td height="20"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
这是处理修改数据的页面.
update_stu_xx_save.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn_fj16.asp" -->
<!--#include file="admin_qx.asp" -->
<% issjcz %>
<%
if request("action")="edit" then
xingming=trim(request("xingming"))
xuehao=trim(request("xuehao"))
zhiwu=trim(request("zhiwu"))
banji=trim(request("banji"))
chushengnianyue=trim(request("chushengnianyue"))'-----------
zhaopian=session("filepath")
minzu=trim(request("minzu"))
zhengzhimianmao=trim(request("zhengzhimianmao"))
jiguan=trim(request("jiguan"))
dangtuanshijian=trim(request("dangtuanshijian"))
wenhuachengdu=trim(request("wenhuachengdu"))
ruwudiqu=trim(request("ruwudiqu"))
youzhengbianma=trim(request("youzhengbianma"))
ruwushijian=trim(request("ruwushijian"))
lianxidianhua=trim(request("lianxidianhua"))
jiatingzhuzhi=trim(request("jiatingzhuzhi"))
xuexiqingkuang=trim(request("xuexiqingkuang"))
gerenjiangli=trim(request("gerenjiangli"))
weijiqingkuang=trim(request("weijiqingkuang"))
gerenpingding=trim(request("gerenpingding"))
zhibupingding=trim(request("zhibupingding"))
sql="select * from stu"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
'rs.addnew
rs("xingming")=xingming
rs("xuehao")=xuehao
rs("zhiwu")=zhiwu
rs("banji")=banji
rs("chushengnianyue")=chushengnianyue
rs("zhaopian")=zhaopian
rs("minzu")=minzu
rs("zhengzhimianmao")=zhengzhimianmao
rs("jiguan")=jiguan
rs("dangtuanshijian")=dangtuanshijian
rs("wenhuachengdu")=wenhuachengdu
rs("ruwudiqu")=ruwudiqu
rs("youzhengbianma")=youzhengbianma
rs("ruwushijian")=ruwushijian
rs("lianxidianhua")=lianxidianhua
rs("jiatingzhuzhi")=jiatingzhuzhi
rs("xuexiqingkuang")=xuexiqingkuang
rs("gerenjiangli")=gerenjiangli
rs("weijiqingkuang")=weijiqingkuang
rs("gerenpingding")=gerenpingding
rs("zhibupingding")=zhibupingding
rs.update
response.Write "<script language=javascript>{window.alert('学员记录添加成功!请点击“确定”继续添加 ');window.location.href='xy_add.asp';}</script>"
setrs(rs)
end if
%>
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2