access数据库和asp页面,怎样才能把文本框里的值传到数据库中
展开全部
<% action=request("action") '或 action=request.form("action"))
if Action="save" then
set rs=server.createobject("adodb.recordset")
Sql="select * from [表名]"
rs.open sql,conn,1,3
rs.addnew
rs("ads")=trim(request.form("ads"))
....略......
rs.Update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('提交成功!');location.href='xx.asp';</script>"
response.End
end if %>
<form name="myform" action="?Action=save" method="post">
地址:<input name="ads" type="text" id="ads" size="50" maxlength="50" />
....略....
<input type="submit" name="Submit2" value=" 提交 " /></form>
if Action="save" then
set rs=server.createobject("adodb.recordset")
Sql="select * from [表名]"
rs.open sql,conn,1,3
rs.addnew
rs("ads")=trim(request.form("ads"))
....略......
rs.Update
rs.close
set rs=nothing
response.Write "<script language='javascript'>alert('提交成功!');location.href='xx.asp';</script>"
response.End
end if %>
<form name="myform" action="?Action=save" method="post">
地址:<input name="ads" type="text" id="ads" size="50" maxlength="50" />
....略....
<input type="submit" name="Submit2" value=" 提交 " /></form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询