| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 952 人关注过本帖
标题:[求助]怎么总是报错?
只看楼主 加入收藏
可见光
Rank: 1
等 级:新手上路
帖 子:143
专家分:0
注 册:2007-6-15
收藏
 问题点数:0 回复次数:11 
[求助]怎么总是报错?
哪个大哥大姐能帮我分析下啊! 小弟先谢谢了


错误类型:
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
%>
搜索更多相关主题的帖子: 编译器 Microsoft 大哥 
2007-08-10 16:49
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 
没有结束 end if

if i>=MaxPerpage then exit do end if

[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-08-10 17:13
可见光
Rank: 1
等 级:新手上路
帖 子:143
专家分:0
注 册:2007-6-15
收藏
得分:0 
回复:(可见光)[求助]怎么总是报错?
我现在把完整的代码给发上来,大家帮我改改吧!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<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 MaxPerpage
MaxPerPage=9
dim text,checkpage
text="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=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>
2007-08-10 17:46
QQQQQQQQQQQQ
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2007-8-10
收藏
得分:0 

[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]

没改动,只是帮你理顺,让高手好看


本人水平有限,所说之话不可全信,也不可不信,
2007-08-10 18:32
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

<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编辑过]

2007-08-10 18:46
QQQQQQQQQQQQ
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2007-8-10
收藏
得分:0 
晕,干嘛学他

本人水平有限,所说之话不可全信,也不可不信,
2007-08-10 18:52
可见光
Rank: 1
等 级:新手上路
帖 子:143
专家分:0
注 册:2007-6-15
收藏
得分:0 

我一直没找到哪有问题!!谢谢yms123和QQQQQQQQQQQQQ

2007-08-10 22:22
愿望
Rank: 1
等 级:新手上路
威 望:1
帖 子:111
专家分:0
注 册:2007-7-28
收藏
得分:0 
你这可怕的缩进,看的人头晕~
5L 版主正解~
你在他加红的 else 前面加一条 end if 试试

2007-08-10 22:27
可见光
Rank: 1
等 级:新手上路
帖 子:143
专家分:0
注 册:2007-6-15
收藏
得分:0 
回复:(可见光)[求助]怎么总是报错?

<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 MaxPerpage
MaxPerPage=9
dim text,checkpage
text="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
if not Rs.eof then Rs.AbsolutePage=CurrentPage end if
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=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
%>
</body>
</html>




因为初学,问题会多一些!请大家多多包涵.....

小弟还有一个问题就是
Microsoft JET Database Engine (0x80040E14)
无效的 SQL语句;期待 'DELETE'、'INSERT'、'PROCEDURE'、'SELECT'、或 'UPDATE'。
/spss.asp, 第 22 行
怎么我发的代码总是堆在一块啊

[此贴子已经被作者于2007-8-11 6:58:24编辑过]

2007-08-11 06:56
可见光
Rank: 1
等 级:新手上路
帖 子:143
专家分:0
注 册:2007-6-15
收藏
得分:0 

高手帮我分析下吧~!@@# 我在调试这个,进行不下去了

2007-08-11 10:47
快速回复:[求助]怎么总是报错?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012454 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved