(追加50分)ASP + Access 如何改变复选框的值,如何批量修改

来源:百度知道 编辑:UC知道 时间:2024/06/21 10:24:11
我在Access里有一个News表,里面有个select项,对应一个复选框。
我想实现的功能是在页面里选中或取消复选框,数据库里相应的值随之而改变。

第二,或者实现多个复选框改变之后,点提交,对应的值都改变。

两个都实现的话追加50分。如果第二个给出详细的思路追加100分。
谢谢lv
把"<input name="top" type="checkbox" value="1" <%if rs("select")=true then response.Write("checked")%>>
改成:
<input name="top_<%=rs("id")%>" type="checkbox" value="1" <%if rs("select")=true then response.Write("checked")%>>
后台代码
<%
if request("action")="editselect" then
set rs1=server.CreateObject("adodb.recordset")
For i = LBound(split(request.form("check"),",")) To UBound(split(request.form("check"),","))

rs1.open "select * from news where id="&cint(split(request.form("check"),",")(i)), conn, 1, 3
if not rs1.e

tmp.asp文件,测试可用。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
dim conn,db
dim connstr
db="tmp.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
if err then
err.clear
else