Microsoft VBScript编译错误' 800a03f6'期待'结束' /itemlookup.asp,第133行

时间:2015-05-17 21:55:56

标签: html vbscript asp-classic

我无法弄清楚为什么我收到此错误消息:Microsoft VBScript编译错误' 800a03f6'期待'结束' /itemlookup.asp,第133行 这是我的整个代码。谁能帮我吗?靠近底部有一个      结束如果

这就是它给我错误的地方。我把整个代码放在下面。

 <style type="text/css" href="test.css"> </style>

</head>


<form method="get" action="itemlookup.asp" > 
<p>
Barcode 1: 
<input type="text" name="barcode1" >
</p>
<p>Locator:
<input type="text" name="locator" >
</p>
<input type="submit" value="Run Request">
<tr> <input type="button" value="New Search" onclick="submit()"/></tr>
</form>



<%


 dim barcode1
 barcode1=Request.QueryString("barcode1") 
 dim locator
 locator=Request.QueryString("locator") 

  set conn=Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "Provider=SQLNCLI10;Server=XX.XX.XX.X;Database=XXXXXX;Uid=XXX; Pwd=XXX;"



 If barcode1<>"" Then 
response.write "<b><h4>" & UCASE(barcode1) & " - Picking History Report - " & time & "</h4></b>"
else If locator<>"" Then 
response.write "<b><h4>" & UCASE(barcode1) & " - Picking History Report - " & time & "</h4></b>"



            sql ="select top 1" _
                                + " INVENTORY.ITEM_CODE as Item_Code," _ 
                + "DELIVERIES_PICKS.description as description," _
                                + "INVENTORY.LOCATOR_CODE as locator," _
                                + "INVENTORY.QTY as qty " & _
                                " FROM INVENTORY JOIN deliveries_picks ON DELIVERIES_PICKS.item_code = INVENTORY.item_code JOIN deliveries_picks_hist ON DELIVERIES_PICKS.item_code = DELIVERIES_PICKS_hist.item_code WHERE DELIVERIES_PICKS_hist.barcode1 = '"+ barcode1 +" or where INVENTORY.LOCATOR_CODE = '" + locator + "' 'group by INVENTORY.LOCATOR_CODE, INVENTORY.ITEM_CODE, DELIVERIES_PICKS.description, INVENTORY.QTY, DELIVERIES_PICKS.barcode1, DELIVERIES_PICKS.barcode2, INVENTORY.QTY, DELIVERIES_PICKS_hist.barcode1, DELIVERIES_PICKS_hist.barcode2"





    rs.Open sql,conn

    end If


    %>
<style type="text/css">
table {font-size: 85%;}
th {font-size: 17; font-family: Clarendon Extended;}

body
{
background-color:;
}


</style>
<table border="1%" width="1%" >
  <tr>
  <font size="10" > <%
  If barcode1<>""  Then 

  for each x in rs.Fields
    response.write("<th><b>" & UCASE(x.name) & "</b></th>")
  next%>
  </tr>
  <%do until rs.EOF%>
    <tr>
    <%for each x in rs.Fields%>
      <td><%Response.Write("<b>" & x.value)%></td>
    <%next
    rs.MoveNext%>
    </tr>
  <%loop
  rs.close
  conn.close

ElseIf  locator<>"" Then 

  for each x in rs.Fields
    response.write("<th><b>" & UCASE(x.name) & "</b></th>")
  next%>
  </tr>
  <%do until rs.EOF%>
    <tr>
    <%for each x in rs.Fields%>
      <td><%Response.Write("<b>" & x.value)%></td>
    <%next
    rs.MoveNext%>
    </tr>
  <%loop
  rs.close
  conn.close

  End If

  %>
</table></font> 


</body>
</html>

1 个答案:

答案 0 :(得分:1)

elseif之间有一个空格:

If barcode1<>"" Then 
    response.write "<b><h4>" & UCASE(barcode1) & " - Picking History Report - " & time & "</h4></b>"
else If locator<>"" Then 
    response.write "<b><h4>" & UCASE(barcode1) & " - Picking History Report - " & time & "</h4></b>"

应该是

ElseIf locator <> "" Then