请教如何用ASP单选按钮的值写入数据库(刚刚学)
<inputtype="radio"name="RadioGroup1"value="1">单选</label></td></tr><tr><td><label><inp...
<input type="radio" name="RadioGroup1" value="1">
单选</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="RadioGroup1" value="2">
单选</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="RadioGroup1" value="3">
单选</label></td>
抱歉 只有5分了
是ACCESS数据库/d1/dc.mdb的cc表单的va项 展开
单选</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="RadioGroup1" value="2">
单选</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="RadioGroup1" value="3">
单选</label></td>
抱歉 只有5分了
是ACCESS数据库/d1/dc.mdb的cc表单的va项 展开
2个回答
展开全部
给你个完整的代码
On Error Resume Next
Dim connStr, DB, Conn, rs
DB="/d1/dc.mdb" ----------------ACC数据库的路径
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DB)
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open connStr
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [cc]", Conn,1,3
rs.addnew
rs("va") = trim(request("RadioGroup1"))
rs.update
rs.close
set rs = nothing
conn.close
set Conn = nothing
On Error Resume Next
Dim connStr, DB, Conn, rs
DB="/d1/dc.mdb" ----------------ACC数据库的路径
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DB)
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open connStr
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [cc]", Conn,1,3
rs.addnew
rs("va") = trim(request("RadioGroup1"))
rs.update
rs.close
set rs = nothing
conn.close
set Conn = nothing
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询