在此先谢谢!
目的:批量有选择的修改数据。
目前问题:只能够修改1个选择,其他的多项选择提示错误:第 1 行: ',' 附近有语法错误
代码:
<!--#include file="../Connections/xinlong.asp" -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open"SELECT * FROM ceshi1 ORDER BY id DESC",MM_xinlong_STRING,1,1
%>
<%
Dim Repeatswt__numRows
Dim Repeatswt__index
for t=0 to ubound(aa)
rec_id=aa(t)'这个就是单个的ID
'这个是修改数据库数据
set rswbdx=server.CreateObject("adodb.recordset")
rswbdx.open"UPDATE ceshi1 SET mingcheng = '"&Request("mingcheng"&rec_id&"")&"',shuipiao = "&Request("shuipiao"&rec_id&"")&",shuliang = "&Request("shuliang"&rec_id&"")&",beizhu = '"&Request("beizhu"&rec_id&"")&"' WHERE id ='"&rec_id&"'",MM_xinlong_STRING,1,1
Set rswbdx = Nothing
next
%>
<!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=utf-8" />
<title>无标题文档</title>
</head>
for t=0 to ubound(aa)
rec_id=trim(aa(t))'这个就是单个的ID
if rec_id<>"" then'加不为空判断
''''''''''''''打印sql
response.Write "UPDATE ceshi1 SET mingcheng = '"&Request("mingcheng"&rec_id&"")&"',shuipiao = "&Request("shuipiao"&rec_id&"")&",shuliang = "&Request("shuliang"&rec_id&"")&",beizhu = '"&Request("beizhu"&rec_id&"")&"' WHERE id ='"&rec_id&"'"
set rswbdx=server.CreateObject("adodb.recordset")
rswbdx.open"UPDATE ceshi1 SET mingcheng = '"&Request("mingcheng"&rec_id&"")&"',shuipiao = "&Request("shuipiao"&rec_id&"")&",shuliang = "&Request("shuliang"&rec_id&"")&",beizhu = '"&Request("beizhu"&rec_id&"")&"' WHERE id ='"&rec_id&"'",MM_xinlong_STRING,1,1
Set rswbdx = Nothing
end if
next
#2
好,我试试看,谢谢
#3
还是
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
第 1 行: ',' 附近有语法错误。
/ceshi/fuxuanxiugai_1.asp,行 16
会不会是第一页的多选框有问题?
#4
显示上看,能够循环,但是除第一条外没有循环的 数值
UPDATE ceshi1 SET mingcheng = '5fgfh',shuipiao = 0,shuliang = 0,beizhu = '5dfgdfhgjdg' WHERE id =5UPDATE ceshi1 SET mingcheng = '',shuipiao = ,shuliang = ,beizhu = '' WHERE id = 4
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
for t=0 to ubound(aa)
rec_id=trim(aa(t))'这个就是单个的ID
if rec_id<>"" then'加不为空判断
''''''''''''''打印sql
response.Write "UPDATE ceshi1 SET mingcheng = '"&Request("mingcheng"&rec_id&"")&"',shuipiao = "&Request("shuipiao"&rec_id&"")&",shuliang = "&Request("shuliang"&rec_id&"")&",beizhu = '"&Request("beizhu"&rec_id&"")&"' WHERE id ='"&rec_id&"'"
set rswbdx=server.CreateObject("adodb.recordset")
rswbdx.open"UPDATE ceshi1 SET mingcheng = '"&Request("mingcheng"&rec_id&"")&"',shuipiao = "&Request("shuipiao"&rec_id&"")&",shuliang = "&Request("shuliang"&rec_id&"")&",beizhu = '"&Request("beizhu"&rec_id&"")&"' WHERE id ='"&rec_id&"'",MM_xinlong_STRING,1,1
Set rswbdx = Nothing
end if
next
#2
好,我试试看,谢谢
#3
还是
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
第 1 行: ',' 附近有语法错误。
/ceshi/fuxuanxiugai_1.asp,行 16
会不会是第一页的多选框有问题?
#4
显示上看,能够循环,但是除第一条外没有循环的 数值
UPDATE ceshi1 SET mingcheng = '5fgfh',shuipiao = 0,shuliang = 0,beizhu = '5dfgdfhgjdg' WHERE id =5UPDATE ceshi1 SET mingcheng = '',shuipiao = ,shuliang = ,beizhu = '' WHERE id = 4
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'