代码如下:
<table width="217" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0099FF">
<tr>
<td width="213" height="155"><form name="form1" method="post" action="">
<label>姓名:
<input name="name" type="text" id="name">
</label>
</form>
<span class="STYLE1"></span>
<form name="form2" method="post" action="index.asp"">
<label>性别:
<input name="sex" type="text" id="sex">
</label>
</form>
<form name="form3" method="post" action="">
<label>年龄:
<input name="age" type="text" id="age">
</label>
</form>
<form name="form4" method="post" action="">
<label>籍贯:
<input name="where" type="text" id="where">
</label>
</form>
<form name="form5" method="post" action="">
<label>
<input name="Submit1" type="submit" id="Submit1" value="提交">
</label>
<label>
<input name="Submit2" type="reset" id="Submit2" value="重置">
</label>
</form>
</td>
</tr>
</table>
<!--#include file="conn.asp"-->
<%
dim sql,name,sex,age,where
set rs=server.createobject("adodb.recordset")
sql="select * from message"
rs.open sql,conn,1,3
rs.addnew
rs("name")=request.Form("name")
rs("sex")=request.Form("sex")
rs("age")=request.Form("age")
rs("where")=request.Form("where")
rs.update
rs.close
conn.close
set rs=nothing
set conn=nothing
response.write("记录添加成功")
%>
蓝色代码为设计表单代码,红色为ASP记录添加代码,其中message为表的名称