ASP +ACCESS 做一个按钮 ,把数据写入数据库,代码怎么写~谢谢了
3个回答
展开全部
<%
if request("ac")="add" then
tit=replace(request("title"),"'","")
sql="insert into news(title) values('"&tit&"')"
conn.execute sql
response.write "<script>alert('数据插入成功');location.href='你要跳转网址'</script>"
response.end
end if
%>
<form action="?ac=add" method="post">
<input type="text" name="title">
<input type="submit" value="添加">
</form>
if request("ac")="add" then
tit=replace(request("title"),"'","")
sql="insert into news(title) values('"&tit&"')"
conn.execute sql
response.write "<script>alert('数据插入成功');location.href='你要跳转网址'</script>"
response.end
end if
%>
<form action="?ac=add" method="post">
<input type="text" name="title">
<input type="submit" value="添加">
</form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询