日期:2014-05-17  浏览次数:20902 次

关于asp中复选框的问题,在线等 ,急!!
我从数据库读出一些记录,每条记录后有个复选框,然后对复选框所选中的每条记录的同一字段进行修改。但是运行后始终报错,具体报错是
SELECT   子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确。

我的代码是

<!--#include   file= "conn.asp "-->

<%exec= "select   *   from   train   where   approve=0 "
set   rs=server.CreateObject( "adodb.recordset ")
rs.open   exec,conn,1,1
%>
<form   name= "form1 "   method= "post "   action= "fuxuan.asp "


<table   width= "102% "   border= "0 "   cellpadding= "0 "   cellspacing= "0 "   bordercolor= "#FFFFFF ">
<%   do   while   not   rs.eof%> <tr>
<td> <%=rs( "id ")%> </td>
<td> <%=rs( "course ")%> </td>
<td> <%=rs( "date ")%> </td>
<td> <%=rs( "location ")%> </td>
<td> <%=rs( "plan ")%> </td>
<td> <%=rs( "status ")%> </td>
<td> <%=rs( "approve ")%> <input   name= "id "   type= "checkbox "   value= <%=rs( "id ")%>   /> </td>
</tr> <%
rs.movenext
loop

%>
</table>
<input   type= "submit "   name= "Submit "   value= "提交 ">

</form>
这上面是表单部分
<%
  ary   =   split(request( "id "), ", ")
  exec= "select   from   train   where   id=ary(i) "
    set   rs=server.createobject( "adodb.recordset ")
    rs.open   exec,conn,1,3

for   i=0   to   ubound(ary)
    rs( "status ")= "disapprove "
rs.update
rs.close
set   rs=nothing
conn.close
set   conn=nothing
next
response.Redirect(test.asp)

%>
麻烦帮我看看问题究竟是不是select的问题?帮我改一下啊!


------解决方案--------------------
ary=split(request( "id ", ", ")
for i=0 to ubound(ary)
exec= "update table set status= 'disapprove ' where id= "&clng(ary(i))
conn.excute exec
next