批量更新的问题

ech0yunyun 2005-06-06 04:15:18
批量更新一张数据库表
大致是这样的 从一张表中读取相关的数据在页面中显示出来
例如 选种的数据

然后我想对显示出来的数据进行更改 然后在更新到数据库中去
希望能指导一下怎么操作

<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../Image/style.css" type=text/css rel=stylesheet>
<script language="JavaScript" src="../Image/js.js"></SCRIPT>
</head>
<body text="#000000">
<%
If Request.QueryString("action")="update" Then

Call userupdate
Else

dim strleixing,strname
Dim ll,sqltext

Set ll = Server.CreateObject("ADODB.RecordSet")

sqltext="Select id, 名称,是否使用 From [车站设定] where 前级编号='0'"

ll.Open sqltext,Conn,1,1

%>
<form method="POST" id="form1" name="form1" action="?action=update" webbot-action="--WEBBOT-SELF--">
<table width="60%" border="0" cellpadding="0" cellspacing="0" align="center" class=TableBorder>
<tr bgcolor=ffffff>
<th height=25 colspan=3 align="center">设定地铁线路
</th>
</tr>

<tr height="22" valign="middle" align="center">
<th width="20%">id</th>
<th width="60%">名称</th>
<th width="20%">操作</th>
</tr>
<%
If ll.Eof Then
Response.Write "<tr height='22' valign='middle' align='center' bgcolor='#FFFFFF'><th colspan='6'>没有该记录!</th></tr>"
Else
dim i
i=0
Do While Not ll.Eof
%>
<tr valign="middle" bgcolor="#FFFFFF" align="center" height="22">
<td width="20%"><%=ll(0)%></td>
<td width="60%"><%=ll(1)%></td>

<%

if trim(ll(2))="否" then
Response.Write "<td width='20%'><input type=text name='"&i&"' value='"&trim(ll(2))&"'></td>"
else
Response.Write "<td width='20%'><input type=text name='"&i&"' value='"&trim(ll(2))&"' checked></td>"
end if
%>
</tr>
<%
ll.MoveNext
i=i+1
Loop
end if
ll.Close
Conn.Close
Set ll=Nothing
Set Conn=Nothing
%>
<tr bgcolor=ffffff>
<th height=25 colspan=3 align="center"><input type="submit" name="Submit" value="提交"></th>
</th>
</tr>
</table>
</form>
<%End if%>
</html>

<%
Sub userupdate
dim i,v
i=0
v=request.Form (0)
Response.Write v
response.end
while v<>""
if v="是" then
updtae [车站设定]
set [是否使用]="是"
from [车站设定]

end if
i=i+1
v=request.Form (i)
wend
End Sub
%>


知道一下怎么读request.Form (i)的信息 我返回出来一直是空 根本没发设定
...全文
53 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ech0yunyun 2005-06-06
  • 打赏
  • 举报
回复
加过的啊
阿门 2005-06-06
  • 打赏
  • 举报
回复
在<FORM>里加上METHOD=“POST”,你request.Form (i)就不是空了

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧