asp问题,很急,我想把单选按钮的值写入数据库,怎么写?只在一个页面里写入。

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:40:31
数据库“datas/#ED-%doujjagiin$seS%C2.0#.asp”
表名:dd
写入字段:zffs

这是我在别的网站看到的提交页面样式(其实就是一个最后支付方式提交页面),希望也写成这样的样式:
<FORM id=payfrom name=payfrom onSubmit="javascript:return gettype();" method=post target=_blank>
<INPUT type=radio value=alipay.asp name=paytype>
<INPUT type=radio value=wy_Send.asp name=paytype>
<INPUT class=btn_xzzffs2 onMouseOver="this.className='btn_xzzffs21'" onMouseOut="this.className='btn_xzzffs2'" type=submit value=" " name=submit23>
</FORM>
我很菜鸟。希望给出一个全面的写入代码。在些谢谢大家的帮助。

本页第二行开始,代码如下:
<!--#include file="conn.asp"-->
<%
if request.form("paytype")<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from 数据表"
rs.addnew
rs("字段名")
rs.update
rs.close
set rs=nothing
response.write "数据写入成功!"
end if
%>

conn.asp 代码如下:

<%
dim db,connstr
db="#hrr.mdb"
set conn = server.CreateObject("ADODB.Connection")
connstr="DBQ="&server.mappath(db)&";DRIVER={Microsoft Access Driver (*.mdb)};"
conn.Open connstr
%>