一個ASP END 錯誤解決過程。

來源:互聯網
上載者:User

原程式:<html>

<head>
<meta content="Microsoft FrontPage 5.0">
<meta content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>認證軟體認證檢查</title>
</head>

<body>
<!--#include file="dbconn.asp"-->

<p align="center"><font color="#FF0000" size="7">尋找漏掉滾動的監督組織資訊   </font></p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="98">
  <tr>

      <td width="5%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">編號</font></td>
    <td width="8%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">記錄序號</font></td>
   <td width="21%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">組織名稱</font></td>
    <td width="8%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">項目編號</font></td>
    <td width="1%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">項目類型</font></td>
    <td width="11%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">實際開始日期</font></td>
    <td width="12%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">實際結束日期</font></td>
 

  
    <td width="17%" height="41" align="center" bgcolor="#FFFF00">
    <font color="#0000FF">認證狀態</font></td>
  </tr>
<%
 set rs=server.createobject("adodb.recordset")
 sql="select a.RecNO RecNo,a.ProjID ProjID,d.PTType PTType,a.ActBegin ActBegin,a.ActEnd ActEnd,c.BsName BsName,a.PTCode PTCode,b.RegiMemo RegiMemo from tblProjectType a,tblProject b,tblBusiness c,tblProjectTypeCode d,tblProjRegi e where (a.PTCode='200' or a.PTCode='300' or a.PTCode='301' or a.PTCode='302' or a.PTCode='303')  and a.PTCode=d.PTCode and a.ProjID=b.ProjID and b.BsID=c.BsID and a.ProjID=e.ProjID and e.RegiCase<>'撤消'  order by a.ProjID,a.PTCode"
 rs.open sql,conn,1,1
 i=0
 do  while not rs.eof

%>
<% dim RecNO,BsName,ProjID,PTType,ActBegin,ActEnd,PTCode,RegiMemo
RecNo=rs("RecNo")
BsName=rs("BsName")
ProjID=rs("ProjID")
PTType=rs("PTType")
PTCode=rs("PTCode")
ActBegin=rs("ActBegin")
ActEnd=rs("ActEnd")
RegiMemo=rs("RegiMemo")
rs.MoveNext
if  rs("ProjID")<>projID  and ActEnd<>"" then
i=i+1
%>
  <tr>
  <td width="5%" height="56" align="center"><%=i%></td>
<td width="8%" height="56" align="center"><%=RecNo %> </td>
  <td width="21%" height="56" align="center"><%=BsName%> </td>
<td width="8%" height="56" align="center"><%=ProjID%> </td>
<td width="8%" height="56" align="center"> <%=PTType%></td>
<td width="11%" height="56" align="center"> <%=ActBegin%></td>
<td width="12%" height="56" align="center"><%=ActEnd%> </td>
<td width="17%" height="56" align="center" valign="middle" bgcolor="#FFCCFF"><%=RegiMemo%><br>

</td>
  </tr>
 <%
end if
loop
%>

</table>

 

</body>

</html>

 

錯誤提示:asp中 Microsoft VBScript 編譯器錯誤 錯誤 '800a03f6'
缺少 'End'

/iisHelp/common/500-100.asp,行242 錯誤 '80020009'

發生意外。

 

原因及解決:開始只以為是語法錯誤,查了很多遍,主要在 END IF上查,都沒找到原因,加個end if又提示多了,提示在if  rs("ProjID")<>projID  and ActEnd<>"" then
發生錯誤,於是想修改一下,

 

<% dim RecNO,BsName,ProjID,PTType,ActBegin,ActEnd,PTCode,RegiMemo,projID2
RecNo=rs("RecNo")
BsName=rs("BsName")
ProjID=rs("ProjID")
PTType=rs("PTType")
PTCode=rs("PTCode")
ActBegin=rs("ActBegin")
ActEnd=rs("ActEnd")
RegiMemo=rs("RegiMemo")
rs.MoveNext
if not rs.eof then
projID2=rs("ProjID")
if projID2<>projID  and ActEnd<>"" then
i=i+1
%>
  <tr>
  <td width="5%" height="56" align="center"><%=i%></td>
    <td width="8%" height="56" align="center"><%=RecNo %> </td>
   <td width="21%" height="56" align="center"><%=BsName%> </td>
    <td width="8%" height="56" align="center"><%=ProjID%> </td>
    <td width="8%" height="56" align="center"> <%=PTType%></td>
    <td width="11%" height="56" align="center"> <%=ActBegin%></td>
    <td width="12%" height="56" align="center"><%=ActEnd%> </td>
    <td width="17%" height="56" align="center" valign="middle" bgcolor="#FFCCFF"><%=RegiMemo%><br>

</td>
  </tr>
 <%
end if
end if

 

OK,成功,原來是 rs.movenext 到底了沒檢測造成的,而END 是VB系統的,並不是程式中的提示的錯誤,微軟的一個誤導。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.