缺少sub的错误,帮看下

kawensong 2009-09-11 09:07:09
没办法asp我一点也不大会 从网上下的模板 测试后台的时候有个页面出现了错误,

错误提示:

Microsoft VBScript 编译器错误 (0x800A03F8)
缺少 'Sub'
/liehuo_good/system/ProductclassDo.asp, line 65, column 4
End if
---^


<!--#include file="fun.asp"-->
<%
Sub main()
id=request("id")
if request("act")="add" then
call add_del_update("productclass","insert","")
response.write "<script language=javascript>alert('添加成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="edit" Then
call add_del_update("productclass","update",id)
response.write "<script language=javascript>alert('修改成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="del" Then
set rs1=server.createobject("adodb.recordset")
sql="select count(*) as recnum from product where cid="&request.querystring("id")
rs1.open sql,conn,1,1
If rs1("recnum")>0 Then
response.write "<script language=javascript>alert('类别下有产品,请先将产品删除!');history.go(-1);</script>"
Else
set rs2=server.createobject("adodb.recordset")
sql="select count(*) as recnum from productclass where big="&request.querystring("id")
rs2.open sql,conn,1,1
If rs2("recnum")>0 Then
response.write "<script language=javascript>alert('类别下有分类,请先将分类删除!');history.go(-1);</script>"
Else
call add_del_update("productclass","delete",id)
response.write "<script language=javascript>alert('删除成功!');history.go(-1);self.location=document.referrer;</script>"
end If
End If
End if
%>
<%
if request("do")="edit" Then
id=request.querystring("id")
set rst=server.createobject("adodb.recordset")
sql="select * from productclass where id="&id
rst.open sql,conn,1,1
end If
%>
<div class="maintitle">产品类别<%if request("do")="edit" Then%>修改<%Else%>添加<%end if%></div>
<table border="1" cellpadding="5" cellspacing="0" class="wmain tabcolor">
<form method="post" name="myform" <%if request("do")="edit" Then%>action="?act=edit&id=<%=rst("id")%>"<%Else%>action="?act=add"<%end If%> onsubmit="return CheckForm(this)">
<tr><td><span class="maintit">栏目:</span><input name="title" type="text" size="20" <%if request("do")="edit" Then%>value="<%=rst("title")%>"<%end If%> check="^\S+$" warning="栏目不能为空,且不能含有空格"></td></tr>
<%if request("do")="edit" Then%> <%if rst("big")<>0 Then%>
<tr><td><span class="maintit">类别:</span>

<%
set rs1=server.createobject("adodb.recordset")
sql = "select * from productclass where big=0"
rs1.open sql,conn,1,1
if rs1.eof and rs1.bof then
response.write "请先添加类别"
else
%>
<select name="big">
<%do while not rs1.eof%>
<option <% if rs1("id")=rst("big") then response.Write("selected") end if%> value="<%=rs1("id")%>"><%=rs1("title")%></option>
<%
rs1.movenext
loop
end If
rs1.close
Set rs1=Nothing
%>
<%else%><%=request.querystring("title")%><%End if%><%else%><input name="big" type="hidden" value="<%=request.querystring("big")%>"><%End if%><%End if%></td></tr>
<tr><td><span class="maintit">排序:</span><input name="paixu" type="text" maxlength="2" size="1" <%if request("do")="edit" Then%>value="<%=rst("paixu")%>"<%end If%> check="^\d+$" warning="请填写正确的数字"></td></tr>
<tr><td><input type="submit" value="提交"></td></tr>
</table>
</form>
<%
if request("do")="edit" Then
rst.close
Set rst=Nothing
end If
End Sub
%>
<!--#include file="system.asp"-->
...全文
198 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
kawensong 2009-09-11
  • 打赏
  • 举报
回复
hookee--太感谢了
lbcleo 2009-09-11
  • 打赏
  • 举报
回复
up
hookee 2009-09-11
  • 打赏
  • 举报
回复

<!--#include file="fun.asp"-->
<%
Sub main()
id=request("id")
if request("act")="add" then
call add_del_update("productclass","insert","")
response.write "<script language=javascript>alert('添加成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="edit" Then
call add_del_update("productclass","update",id)
response.write "<script language=javascript>alert('修改成功!');history.go(-1);self.location=document.referrer;</script>"
end If
if request("act")="del" Then
set rs1=server.createobject("adodb.recordset")
sql="select count(*) as recnum from product where cid="&request.querystring("id")
rs1.open sql,conn,1,1
If rs1("recnum")>0 Then
response.write "<script language=javascript>alert('类别下有产品,请先将产品删除!');history.go(-1);</script>"
Else
set rs2=server.createobject("adodb.recordset")
sql="select count(*) as recnum from productclass where big="&request.querystring("id")
rs2.open sql,conn,1,1
If rs2("recnum")>0 Then
response.write "<script language=javascript>alert('类别下有分类,请先将分类删除!');history.go(-1);</script>"
Else
call add_del_update("productclass","delete",id)
response.write "<script language=javascript>alert('删除成功!');history.go(-1);self.location=document.referrer;</script>"
end If
End If
End if
if request("do")="edit" Then
id=request.querystring("id")
set rst=server.createobject("adodb.recordset")
sql="select * from productclass where id="&id
rst.open sql,conn,1,1
end If
%>
<div class="maintitle">产品类别<%if request("do")="edit" Then%>修改<%Else%>添加<%end if%></div>
<table border="1" cellpadding="5" cellspacing="0" class="wmain tabcolor">
<form method="post" name="myform" <%if request("do")="edit" Then%>action="?act=edit&id=<%=rst("id")%>"<%Else%>action="?act=add"<%end If%> onsubmit="return CheckForm(this)">
<tr><td><span class="maintit">栏目:</span><input name="title" type="text" size="20" <%if request("do")="edit" Then%>value="<%=rst("title")%>"<%end If%> check="^\S+$" warning="栏目不能为空,且不能含有空格"></td></tr>
<%if request("do")="edit" Then%> <%if rst("big")<>0 Then%>
<tr><td><span class="maintit">类别:</span>
<%
set rs1=server.createobject("adodb.recordset")
sql = "select * from productclass where big=0"
rs1.open sql,conn,1,1
if rs1.eof and rs1.bof then
response.write "请先添加类别"
else
%>
<select name="big">
<%do while not rs1.eof%>
<option <% if rs1("id")=rst("big") then response.Write("selected") end if%> value="<%=rs1("id")%>"><%=rs1("title")%></option>
<%
rs1.movenext
loop
end If
rs1.close
Set rs1=Nothing
%>
<%else%><%=request.querystring("title")%><%End if%><%else%><input name="big" type="hidden" value="<%=request.querystring("big")%>"><%End if%></td></tr>
<tr><td><span class="maintit">排序:</span><input name="paixu" type="text" maxlength="2" size="1" <%if request("do")="edit" Then%>value="<%=rst("paixu")%>"<%end If%> check="^\d+$" warning="请填写正确的数字"></td></tr>
<tr><td><input type="submit" value="提交"></td></tr>
</table>
</form>
<%
if request("do")="edit" Then
rst.close
Set rst=Nothing
end If
End Sub
%>
<!--#include file="system.asp"-->


rdnglydm 2009-09-11
  • 打赏
  • 举报
回复
SUB是要对应的。上面有SUB MANIN(),下面就要有END SUB。你对照一下,是不是缺少一个。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧