CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

该语句错在哪?

楼主liuxingyi(富贵兵团)2004-08-04 10:53:26 在 Web 开发 / ASP 提问

Microsoft   VBScript   编译器错误   错误   '800a0401'    
   
  语句未结束    
   
  /Shop/Search_Class.asp,行17    
   
  Rs.Open   "Select   *   From   Products   A,BusinessApplication   B,BusinessHome   C   Where     C.BusinessHome_Num=A.Product_BusinessHomeNum     And   DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime,"   ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now(),"   ")-1))),2))=0   And   A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,1  
  ------------------------------------------------------------------------------------------------------------------------------------------^  
  问题点数:0、回复次数:9Top

1 楼chengzhaona(zhaoyin)回复于 2004-08-04 11:01:26 得分 0

再sql   server里用查询分析器来执行sql语句试试Top

2 楼kebeixueng(脱变的蚕)回复于 2004-08-04 11:07:29 得分 0

Rs.Open   "Select   *   From   Products   A,BusinessApplication   B,BusinessHome   C   Where     C.BusinessHome_Num=A.Product_BusinessHomeNum     And   DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime,"   ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now(),"   ")-1))),2))=0   And   A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,3  
  Top

3 楼baby21st(愚人|南京www.njci.net)回复于 2004-08-04 11:09:36 得分 0

str   =   DateDiff("d",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime,"   ")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now(),"   ")-1))),2))  
   
  resposne.write   str   &   "<br>"'看是否正确  
   
  strSql   =   "Select   *   From   Products   A,BusinessApplication   B,BusinessHome   C   Where     C.BusinessHome_Num=A.Product_BusinessHomeNum     And   "&str&"   =0   And   A.Product_BusinessHomeNum=B.Application_BusinessHomeNum"  
  response.write   strSql   '看是否正确  
   
  Rs.Open   strSql,   Conn,1,1  
  Top

4 楼jervis82(我是海绵.吸.吸.吸...)回复于 2004-08-04 11:10:39 得分 0

太过长的sql语句建议分开来写。这样比较直观点吧。太长我看不懂。没有一点层次感。Top

5 楼sheng9hhd(无形)回复于 2004-08-04 11:13:08 得分 0

Rs.Open   "Select   *   From   Products   A,BusinessApplication   B,BusinessHome   C   Where     C.BusinessHome_Num=A.Product_BusinessHomeNum     And   DateDiff(""d"",Format_Time(Cdate(Mid(Product_DataTime,1,(InstrRev(Product_DataTime,""   "")-1))),2),Format_Time(Cdate(Mid(Now(),1,(InstrRev(Now(),""   "")-1))),2))=0   And   A.Product_BusinessHomeNum=B.Application_BusinessHomeNum",Conn,1,1Top

6 楼sheng9hhd(无形)回复于 2004-08-04 11:13:21 得分 0

"-->""Top

7 楼sunjiujiu(绿茶狂人@抵制日货)回复于 2004-08-04 11:17:03 得分 0

你把这个语句response.write出来,然后到sql的查询分析器中去执行一下看看Top

8 楼littlejc2(半半)回复于 2004-08-04 11:31:50 得分 0

似的,就只有这个办法,另外这个错误以我的经验来看是没有加换行符"_",你试试在换行的时候加这个符号试试Top

9 楼littlejc2(半半)回复于 2004-08-04 11:35:05 得分 0

给你一端调试过的语句看看:  
  <!--#include   file="conn.asp"-->  
  <html>  
  <head>  
  <title>入库数据搜索结果</title>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  </head>  
   
  <body   bgcolor="#C0C0C0">  
  <%  
  dim   binAddedWhere                                       'as   boolean  
  strSQL="SELECT   *   from   rkgl"  
  binAddedWhere=False  
  if   request("tihuoren")<>""Then  
  if   not   binAddedWhere     then  
      strSQL=strSQL&"   where   "  
        binAddedWhere=true  
        End   if  
              strSQL=strSQL&"     采购人   LIKE   '%"_  
              &   request("tihuoren")_  
        &"%'"  
  end   if  
  if   Request("thnumber")<>""Then  
                    if   not   binAddedWhere   Then  
      strSQL=strSQL&"   where   "  
      binAddedWhere=true  
                      Else  
      strSQL=strSQL&"   and   "  
      end   if  
      strSQL=strSQL&"   数量   "  
      if   request("thsl")="LT"   then  
                        strSQL=strSQL&"<"  
      Elseif   request("thsl")="EQ"then  
                            strSQL=strSQL&"="  
        else  
                                  strSQL=strSQL&">"  
  end   if  
  strSQL=strSQL&CDBL(Request("thnumber"))  
  end   if  
  if   Request("unitprice")<>""Then  
                    if   not   binAddedWhere   Then  
      strSQL=strSQL&"   where   "  
      binAddedWhere=true  
                      Else  
      strSQL=strSQL&"   and   "这个地方不都有换行符吗  
      end   if  
    strSQL=strSQL&"单价"  
      if   request("dj")="LT"   then  
                        strSQL=strSQL&"<"  
      Elseif   request("dj")="EQ"then  
                            strSQL=strSQL&"="  
        else  
                                  strSQL=strSQL&">"  
  end   if  
  strSQL=strSQL&CDbl(Request("unitprice"))  
  end   if  
  if   request("order")<>""Then  
                      if   Not   binAddedWhere   Then  
        strSQL=strSQL&"   where   "  
        binAddedWhere=true  
        else    
        strSQL=strSQL&"   and   "  
        End   if  
        strSQL=strSQL&"     入库编号   ="_*********这个地方不都有换行符吗  
        &   request("order")  
        end   if  
         
        if   request("jingshouren")<>""Then  
                      if   Not   binAddedWhere   Then  
        strSQL=strSQL&"   where   "  
        binAddedWhere=true  
        else    
        strSQL=strSQL&"   and   "  
        End   if  
        strSQL=strSQL&"     入库经手人   LIKE   '%"_  
        &   request("jingshouren")_  
        &"%'"  
         
   
    end   if  
  strSQL=strSQL&_  
  "   ORDER   BY     入库编号"  
   
                                                  response.Write(strSQL)  
  set   rs1=conn.execute(strSQL)  
   
   
  %>  
         
   
  <table   border="0"   cellpadding="0"   cellspacing="0"   style="border-collapse:   collapse"   bordercolor="#111111"   width="100%"   id="AutoNumber1">  
      <tr>  
          <td   width="16%"   align="center">  
          <p   align="left">入库编号</td>  
          <td   width="16%"   align="center"> 采购人</td>  
          <td   width="17%"   align="center"> 品名</td>  
          <td   width="17%"   align="center"> 数量</td>  
          <td   width="17%"   align="center"> 单价</td>  
          <td   width="17%"   align="center">入库经手人</td>  
      </tr>  
  </table>  
  <%  
                  DO   WHILE   NOT   rs1.EOF  
                  %>  
   
  <table   border="0"   cellpadding="0"   cellspacing="0"   style="border-collapse:   collapse"   bordercolor="#111111"   width="100%"   id="AutoNumber2">  
      <tr>  
          <td   width="16%"   align="center">     <%=rs1("入库编号")%> </td>  
          <td   width="16%"   align="center"> <%=rs1("采购人")%>     </td>  
          <td   width="17%"   align="center">     <%=rs1("品名")%> </td>  
          <td   width="17%"   align="center">     <%=rs1("数量")%> </td>  
          <td   width="17%"   align="center"> <%=rs1("单价")%>     </td>  
          <td   width="17%"   align="center"> <%=rs1("入库经手人")%>     </td>  
      </tr>  
  </table>  
    <%         rs1.MOVENEXT  
        LOOP  
    %>  
   
  </body>  
  </html>  
  <%  
  rs1.close  
  set   rs1=nothing  
  conn.close  
  set   conn=nothing  
   
  %>Top

相关问题

  • sql语句错在那里?
  • sql语句错在哪里?
  • sql语句错在哪里?
  • sql语句错在哪里?
  • SELECT 语句错在哪里
  • SQL 语句错在哪?
  • 语句错在哪里
  • 以下语句错在哪里?
  • 请问这条语句错在哪儿?
  • 这个sql语句错在哪里?

关键词

  • strsql
  • binaddedwhere
  • 入库
  • ifstrsql
  • ifif
  • request
  • then
  • 编号
  • true else
  • where

得分解答快速导航

  • 帖主:liuxingyi

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo