打印

[asp] 高手帮检查一下,语法错误 (操作符丢失)的问题

错误类型:
Microsoft JET Database Engine (0x80040E14)
语法错误 (操作符丢失) 在查询表达式 'WHERE F_ID IN (139, 138)' 中。
/studyyard/admin/upload/adminpic.asp, 第 50 行


浏览器类型:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2)

网页:
GET /studyyard/admin/upload/adminpic.asp

时间:
2008年5月21日 星期三, 2:28:26


<!--#include file="../../Connections/upload.asp" -->
<%
Dim Recpic
Dim Recpic_cmd
Dim Recpic_numRows

Set Recpic_cmd = Server.CreateObject ("ADODB.Command")
Recpic_cmd.ActiveConnection = MM_upload_STRING
Recpic_cmd.CommandText = "SELECT * FROM pic ORDER BY p_SubmitTime DESC"
Recpic_cmd.Prepared = true

Set Recpic = Recpic_cmd.Execute
Recpic_numRows = 0
%>
<%
If (Request.QueryString("action")="deletpic" AND Request.QueryString("F_ID")<>"") Then
Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MM_upload_STRING
Command1.CommandText = "DELETE FROM iXs_UpFiles  WHERE F_ID IN (" & Request.QueryString("F_ID") & ")"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

Set RecDelpic_cmd = Server.CreateObject ("ADODB.Command")
RecDelpic_cmd.ActiveConnection = MM_upload_STRING
RecDelpic_cmd.CommandText = "SELECT F_ID, F_Name FROM iXs_UpFiles WHERE WHERE F_ID IN (" &Request.QueryString("F_ID") & ")"
Recpic_cmd.Prepared = true
Set RecDelpic = RecDelpic_cmd.Execute              
While (Not RecDelpic.EOF)
       Dim objFSO
       Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
       If objFSO.FileExists(Server.MapPath("UpLoadFile/"&(Recpic.Fields.Item("F_Name").Value))) Then
         objFSO.DeleteFile Server.MapPath("UpLoadFile/"&(Recpic.Fields.Item("F_Name").Value)),True         
       End If
       Set objFSO=Nothing
       RecDelpic.MoveNext
Wend
RecDelpic.Close()
Set RecDelpic = Nothing
'执行转页操作
Response.Redirect("adminpic.asp")

end if
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recpic_numRows = Recpic_numRows + Repeat1__numRows
%>
<!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>
<script type="text/javascript">
function setWindowSize(){ //iframe自动本窗口高度
try{
  var thiswin = window.parent.document.getElementById(window.name);
  if(window.document.body.scrollWidth-thiswin.offsetWidth>6){
   document.body.style.overflowX="auto";
   thiswin.height=window.document.body.scrollHeight+20;
   thiswin.width=window.document.body.scrollWidth+20;
  }else{
   document.body.style.overflowX="hidden";
   thiswin.height=window.document.body.scrollHeight;
   thiswin.width=window.document.body.scrollWidth
  }
}catch(e){ }
}
</script>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="../../style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.pic {
       height: 75px;
       width: 100px;
       border: 3px solid #CCCCCC;
}
-->
</style>
</head>

<body onLoad="setWindowSize()">
<% If Not Recpic.EOF Or Not Recpic.BOF Then %>
  <form id="form1" name="form1" method="get" action="">
    <table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="25"><input type="submit" name="button" id="button" value="删除"/>
        <input name="action" type="hidden" id="action" value="deletpic" /></td>
      </tr>
     
      <tr>
        <%
While ((Repeat1__numRows <> 0) AND (NOT Recpic.EOF))
%>
        <td align="center"><img src="UpLoadFile/<%=(Recpic.Fields.Item("F_Name").Value)%>" alt="" class="pic" />
            <label>
            <input type="checkbox" name="F_ID" id="F_ID" value="<%=(Recpic.Fields.Item("F_ID").Value)%>" />
          </label></td>
        <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recpic.MoveNext()
  if (Repeat1__index mod 6 = 0) then response.write("</tr>")
Wend
%>
      </tr>
    </table>
    <label></label>
  </form>
  <% End If ' end Not Recpic.EOF Or NOT Recpic.BOF %>
<% If Recpic.EOF And Recpic.BOF Then %>
  <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td align="center" class="news">还没有上传图片!</td>
    </tr>
  </table>
  <% End If ' end Recpic.EOF And Recpic.BOF %>
</body>
</html>
<%
Recpic.Close()
Set Recpic = Nothing
%>
RecDelpic_cmd.CommandText = "SELECT F_ID, F_Name FROM iXs_UpFiles WHERE WHERE F_ID IN (" &Request.QueryString("F_ID") & ")"

SQL文中多了一个WHERE。测试的时候仔细一些啊。
ForgotteN
多了一个Where 并且用Request.QueryString("F_ID") 读取的时候中间会有空隔出现.
得了谢谢