急! 记录添加无内容显示???
我编写了如下代码,希望向数据库中添加四个字段的记录,但是添加后只能看到数据库中记录号增加,看不到任何记录内容??请高手赐教!<BR>代码如下:<BR><FONT color=#3300ff><table width="217" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0099FF"><BR> <tr><BR> <td width="213" height="155"><form name="form1" method="post" action=""><BR> <label>姓名:<BR> <input name="name" type="text" id="name"><BR> </label><BR> </form><BR> <span class="STYLE1"></span><BR> <form name="form2" method="post" action="index.asp""><BR> <label>性别:<BR> <input name="sex" type="text" id="sex"><BR> </label><BR> </form><BR> <form name="form3" method="post" action=""><BR> <label>年龄:<BR> <input name="age" type="text" id="age"><BR> </label><BR> </form><BR> <form name="form4" method="post" action=""><BR> <label>籍贯:<BR> <input name="where" type="text" id="where"><BR> </label><BR> </form><BR> <form name="form5" method="post" action=""><BR> <label><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR> <input name="Submit1" type="submit" id="Submit1" value="提交"><BR> </label><BR> <label><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR> <input name="Submit2" type="reset" id="Submit2" value="重置"><BR> </label><BR> </form><BR> </td><BR> </tr><BR></table><BR></FONT><FONT color=#ff0000><!--#include file="conn.asp"--><BR><%<BR>dim sql,name,sex,age,where<BR>set rs=server.createobject("adodb.recordset")<BR>sql="select * from message"<BR>rs.open sql,conn,1,3<BR>rs.addnew<BR>rs("name")=request.Form("name")<BR>rs("sex")=request.Form("sex")<BR>rs("age")=request.Form("age")<BR>rs("where")=request.Form("where")<BR>rs.update<BR>rs.close<BR>conn.close<BR>set rs=nothing<BR>set conn=nothing<BR>response.write("记录添加成功")<BR>%><BR></FONT><FONT color=#000000>蓝色代码为设计表单代码,红色为ASP记录添加代码,其中message为表的名称</FONT>页:
[1]
