原程序:<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系统的,并不是程序中的提示的错误,微软的一个误导。