如何把单选按钮的值传到数据库里

来源:百度知道 编辑:UC知道 时间:2024/05/23 14:31:06
我做了个性别的单选按钮组 男和女 请问如何才能传到数据库里 我用的是ASP+ACCESS <input name="sex" type="radio" id="radio" value="1" checked="checked" />
<input type="radio" name="sex" id="radio2" value="0" /> 这个是男女的代码。 请问ACCESS里面应该如何设置 ASP里面应该怎么设置?

<%
if request.Form("act")="ok" then
response.Write(request.Form("sex"))
'假设记录集为rs
'rs.addnew
'rs("数据库中的字段")=request.Form("sex")
'rs.update()
end if
%>
<form action="" method="post">
<input name="sex" type="radio" id="radio" value="1" checked="checked" />
<input type="radio" name="sex" id="radio2" value="0" />
<input type="hidden" name="act" id="act" value="ok" />
<input type="submit" name="button" id="button" value="提交" />
</form>

用SQL语句
还要写conn.asp

具体的不会