错误类型:
Microsoft VBScript 编译器错误 (0x800A03F6)
缺少 'End'
/spss.asp, 第 81 行
源码:
<% '77
i=i+1 '78
if i>=MaxPerpage then exit do '79
rs.MoveNext '80
Loop '81
end Sub '82
%>
[QUOTE]<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title></head><body><!--#include file="conn.asp"-->
<%
spxl=request("spxl")
set rs=server.CreateObject("adodb.recordset")
sqltest="select *from Product"
if request("Product_Name")<>"" then
sqltext=sqltext&"where Product_Name like'%"&request("Product_Name")&"%'"
else
sqltext=sqltext&"where Product_Name like'%"&""&"%'"
end if
if request("Product_Class")<>"" then
sqltext=sqltext&"and Class_1 like '%"+request("Product_Class")+"%'"
end if
rs.open sqltext,conn,1,1
dim MaxPerpageMaxPerPage=9
dim text,checkpagetext="0123456789"
Rs.Pagesize=MaxPerpage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
if checkpage<>0 then
if not Isempty(request("page")) then
CurrentPage=Cint(request("page"))
if CurrentPage<1 then CurrentPage=1
if CurrentPage>Rs.PageCount then CurrentPage=Rs.PageCount
else
CurrentPage=1
end if
%>
<script>
function openbag(id){
windows.open("eshop.asp?cpbm="+id,"","height=200,width=700,left=190,top=0,reszable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
<%
if rs.eof and rs.bof then
response.Write"<td><p align='center'><font color='#ff0000'>没有符合条件的cd</font></p></td>"
response.end
end if
%>
<%
row_count=1Sub list()
%>
<%
i=0
Do While Not Rs.Eof
%>
<tr><td width="16%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Id")%>
</td><td width="34%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Name")%>
</td><td width="18%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("P_NewPrice")%></td><td width="17%" align="center" height="28" bgcolor="#CCCCCC">
<a href="spjj.asp?ProductNO=<%=rs("Product_No")%>">详细资料</a></td>
<td width="15%" align="center" height="28" bgcolor="#CCCCCC">
<a href='javascript:openbag("<%=rs("Product_Id")%>)'>
<img style="cursor:hand " src="image/mybuy.gif" width="35" height="12" border="0" align="absmiddle">
</a></td></tr>
<%
i=i+1
if i>=MaxPerpage then exit do
rs.MoveNext
loop
end Sub
end if
%></body></html>[/QUOTE]
没改动,只是帮你理顺,让高手好看
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title></head><body><!--#include file="conn.asp"-->
<%
spxl=request("spxl")
set rs=server.CreateObject("adodb.recordset")
sqltest="select *from Product"
if request("Product_Name")<>"" then
sqltext=sqltext&"where Product_Name like'%"&request("Product_Name")&"%'"
else
sqltext=sqltext&"where Product_Name like'%"&""&"%'"
end if
if request("Product_Class")<>"" then
sqltext=sqltext&"and Class_1 like '%"+request("Product_Class")+"%'"
end if
rs.open sqltext,conn,1,1
dim MaxPerpageMaxPerPage=9
dim text,checkpagetext="0123456789"
Rs.Pagesize=MaxPerpage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
'这里的if判断写得很混乱,
if checkpage<>0 then
if not Isempty(request("page")) then
CurrentPage=Cint(request("page"))
if CurrentPage<1 then CurrentPage=1
if CurrentPage>Rs.PageCount then CurrentPage=Rs.PageCount
else
CurrentPage=1
end if
'这里的else end if对应不上。
%>
<script>
function openbag(id){
windows.open("eshop.asp?cpbm="+id,"","height=200,width=700,left=190,top=0,reszable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
<%
if rs.eof and rs.bof then
response.Write"<td><p align='center'><font color='#ff0000'>没有符合条件的cd</font></p></td>"
response.end
end if
%>
<%
row_count=1
Sub list()
%>
<%
i=0
Do While Not Rs.Eof
%>
<tr>
<td width="16%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Id")%>
</td>
<td width="34%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("Product_Name")%>
</td>
<td width="18%" align="center" height="28" bgcolor="#CCCCCC">
<%=rs("P_NewPrice")%>
</td>
<td width="17%" align="center" height="28" bgcolor="#CCCCCC">
<a href="spjj.asp?ProductNO=<%=rs("Product_No")%>">详细资料</a>
</td>
<td width="15%" align="center" height="28" bgcolor="#CCCCCC">
<a href='javascript:openbag("<%=rs("Product_Id")%>)'>
<img style="cursor:hand " src="image/mybuy.gif" width="35" height="12" border="0" align="absmiddle">
</a>
</td>
</tr>
<%
i=i+1
if i>=MaxPerpage then exit do
rs.MoveNext
loop
end Sub
end if
%>
</body>
</html>
这个end if的if语句在那里?写程序就跟写字一样要养成良好的书写习惯,比如太长的语句最好分行写就是一种习惯。
[此贴子已经被作者于2007-8-10 19:31:01编辑过]
我一直没找到哪有问题!!谢谢yms123和QQQQQQQQQQQQQ
[此贴子已经被作者于2007-8-11 6:58:24编辑过]
高手帮我分析下吧~!@@# 我在调试这个,进行不下去了