ASP代码问题,不能添加记录
<%ifrequest("type")="new"then%><formname="form1"method="post"action="record.asp?actio...
<% if request("type")="new" then%>
<form name="form1" method="post" action="record.asp?action=add">
<table width="95%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#cccccc">
<tr bgcolor="#E7E7E7">
<td colspan="2"><div align="center">添加新工作记录</div></td>
</tr>
<tr bgcolor="#F6F6F6">
<td width="19%" height="34">工作记录标题</td>
<td width="81%"><input name="record_title" type="text" class="bottom" size="60">
*必须填写 </td>
</tr>
<tr bgcolor="#F6F6F6">
<td>工作时间</td>
<td><input name="record_time" type="text" class="bottom" id="record_time"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td>组织者姓名</td>
<td><input name="record_author" type="text" class="bottom" ></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"> <input type="submit" name="ok" value="确定新增" class="bottom">
<input type="reset" name="Reset" value="清空重写" class="bottom"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"></td>
</tr>
</table>
</form>
<% End If %>
<%
dim rs1,rs2
dim sql1,sql2
If Request.Form("ok")="确定新增" Then
record_title=request("record_title")
record_time=request("record_time")
record_author=request("record_author")
End If
If request("action")="add" Then
set rs1=server.CreatObject("adodb.recordset")
rs1.Open "jjh_record",conn,3,3
rs1.addnew
rs1("record_title")=record_title
rs1("record_time")=record_time
rs1("record_author")=record_author
rs1.update
rs1.close
response.Redirect("record.asp")
end if
%>
jjh_record是数据库表的名字啊?有问题吗? 展开
<form name="form1" method="post" action="record.asp?action=add">
<table width="95%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#cccccc">
<tr bgcolor="#E7E7E7">
<td colspan="2"><div align="center">添加新工作记录</div></td>
</tr>
<tr bgcolor="#F6F6F6">
<td width="19%" height="34">工作记录标题</td>
<td width="81%"><input name="record_title" type="text" class="bottom" size="60">
*必须填写 </td>
</tr>
<tr bgcolor="#F6F6F6">
<td>工作时间</td>
<td><input name="record_time" type="text" class="bottom" id="record_time"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td>组织者姓名</td>
<td><input name="record_author" type="text" class="bottom" ></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"> <input type="submit" name="ok" value="确定新增" class="bottom">
<input type="reset" name="Reset" value="清空重写" class="bottom"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"></td>
</tr>
</table>
</form>
<% End If %>
<%
dim rs1,rs2
dim sql1,sql2
If Request.Form("ok")="确定新增" Then
record_title=request("record_title")
record_time=request("record_time")
record_author=request("record_author")
End If
If request("action")="add" Then
set rs1=server.CreatObject("adodb.recordset")
rs1.Open "jjh_record",conn,3,3
rs1.addnew
rs1("record_title")=record_title
rs1("record_time")=record_time
rs1("record_author")=record_author
rs1.update
rs1.close
response.Redirect("record.asp")
end if
%>
jjh_record是数据库表的名字啊?有问题吗? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询