ASP无法 写入数据到SQL2000数据库,但提交时没报错
表单:<formname="form3"method="post"action="info_sorts_save.asp?action=add"><inputtype="...
表单:
<form name="form3" method="post" action="info_sorts_save.asp?action=add">
<input type="hidden" name="smt_id" value="<%=request("id")%>">
<input type="hidden" name="sortone" value="<%=request("one")%>">
<tr align="center" bgcolor="#efefef">
<td width="15%" height="30">小类添加</td>
<td width="25%"><input name="sorttwo" type="text" size=15></td>
<td width="12%">小类图片</td>
<td width="27%"><input name="pic2" type="text" size=30 /></td>
<td width="21%"><input type="submit" name="Submit" value="添加" class="input1"></td>
</tr>
</form>
判断页:
<%if request("action")="add" then
dim sorttwo
sorttwo=request("sorttwo")
pic=request("pic")
if pic="" then pic=null
if sorttwo="" then
response.write "<script>alert('对不起,小类栏目不能为空!');history.go(-1);</Script>"
Response.End
end if
set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from sorttwo"
rs.open sql,conn,1,3
rs.AddNew
rs("sorttwo")=sorttwo
rs("sortone")=request("sortone")
rs("sortone_id")=request("sortone_id")
rs("pic")=pic
rs("date")=now
rs.Update
rs.Close
set rs=nothing
conn.Close
set conn=nothing
Response.Redirect "info_sort.asp"
end if%>
写入数据库.也不提示错误.数据库也没新记录.高手看看怎么回事? 展开
<form name="form3" method="post" action="info_sorts_save.asp?action=add">
<input type="hidden" name="smt_id" value="<%=request("id")%>">
<input type="hidden" name="sortone" value="<%=request("one")%>">
<tr align="center" bgcolor="#efefef">
<td width="15%" height="30">小类添加</td>
<td width="25%"><input name="sorttwo" type="text" size=15></td>
<td width="12%">小类图片</td>
<td width="27%"><input name="pic2" type="text" size=30 /></td>
<td width="21%"><input type="submit" name="Submit" value="添加" class="input1"></td>
</tr>
</form>
判断页:
<%if request("action")="add" then
dim sorttwo
sorttwo=request("sorttwo")
pic=request("pic")
if pic="" then pic=null
if sorttwo="" then
response.write "<script>alert('对不起,小类栏目不能为空!');history.go(-1);</Script>"
Response.End
end if
set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from sorttwo"
rs.open sql,conn,1,3
rs.AddNew
rs("sorttwo")=sorttwo
rs("sortone")=request("sortone")
rs("sortone_id")=request("sortone_id")
rs("pic")=pic
rs("date")=now
rs.Update
rs.Close
set rs=nothing
conn.Close
set conn=nothing
Response.Redirect "info_sort.asp"
end if%>
写入数据库.也不提示错误.数据库也没新记录.高手看看怎么回事? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询