| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2294 人关注过本帖
标题:[求助]问个asp的问题?
只看楼主 加入收藏
gesila990
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2006-1-5
收藏
得分:0 
我又来了,代码如下
<%StartPageNum=1
do while StartPageNum+15<=CurPage
StartPageNum=StartPageNum+15
Loop
EndPageNum=StartPageNum+14
第145行:If EndPageNum>RS.Pagecount
then EndPageNum=RS.Pagecount
%>

错误提示如下:
  • 错误类型:
    Microsoft VBScript 编译器错误 (0x800A03F9)
    缺少 'Then'
    /club/bbs.asp, line 145, column 26
    If EndPageNum>RS.Pagecount
    -------------------------^

  • 浏览器类型:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)

  • 网页:
    GET /club/bbs.asp

    请帮忙解决!

  • 一个新手,但是是一个asp的爱好者,希望大家帮忙!
    2006-01-18 12:02
    rainic
    Rank: 6Rank: 6
    等 级:贵宾
    威 望:27
    帖 子:2367
    专家分:0
    注 册:2005-8-9
    收藏
    得分:0 
    If EndPageNum>RS.Pagecount then
    EndPageNum=RS.Pagecount
    应该这样

    2006-01-18 12:51
    gesila990
    Rank: 1
    等 级:新手上路
    帖 子:42
    专家分:0
    注 册:2006-1-5
    收藏
    得分:0 

    <%
    dim conn,rs
    dim owner,id,topid,layer,order
    dim CurPage
    If Request.QueryString("CurPage")= "" or Request.QueryString("CurPage") = 0 then
    CurPage =1
    Else
    CurPage = CINT(Request.QueryString("CurPage"))
    End If

    owner=request.querystring("owner")
    id=request.querystring("id")
    topid=request.querystring("topid")
    layer=request.querystring("layer")
    order=request.querystring("order")
    page=request.querystring("page")

    set conn=server.createobject("adodb.connection")
    DBPath=Server.MapPath("../data/bbs.mdb")
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
    set rsuser=server.createobject("adodb.recordset")
    set rsuser=conn.execute("Select * From User Where User='" & owner & "'")
    dim bbsname
    bbsname=rsuser("subject")
    rsuser.close
    set rsuser=nothing
    %>
    <html>
    <head>
    <title> @ 论坛 - <%=bbsname%></title>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    <style type=text/css><!--td {font family:宋体;font-szie:9pt}body{ font-family:宋体;font-size:9pt}select{ font-family:宋体;font-size:9pt}A{text-decoration:none;font-family:宋体;font-size:9pt}A:hover{text-decoration:underline;color:#CC0000;font-family:"宋体";font-size:9pt};big{font-family:宋体;font-size:12pt}
    --></style>
    </head>
    <body text="#000000" vlink="#330099"
    link="#3300CC"topmargin="2"
    background="#000000">
    <form action=bbs.asp method=get>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" height="20" width="35%">
    <p align="left"><b>版主:</b></p>
    </td>
    <td align="right" height="20" width="65%"><b>|</b>
    <a href="home.asp">社区首页</a><b>|</b>
    <a href="Bank/Index.asp">银行</a><b>|</b>
    <a href="bet/index.asp">赌场</a><b>|</b>
    <a href="regusers.asp">排行榜</a><b>|</b>
    <a href="good.asp?owner=<%=owner%>"> 精 华 版 </a><b>|</b>
    <a href="../Reg/register.htm"> 注 册 </a></b><b>|</b></b>
    <a href="help.htm"target="_blank"></b></b>
    <a href="logout.asp"> 离 开 </a></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="3">
    , <tr><td><span class="big">
    <b><img src="../images/tty.GIF" width="23" height="18"><%=bbsname%></b></span><br>
    </td> </tr>
    </table>
    <%rs.open "SELECT * FROM bbs WHERE Owner='" & owner & "' ORDER BY LastTime DESC,TopID DESC,[Order]",Conn,1,1
    if not rs.eof and not rs.bof then
    RS.PageSize=30
    Dim TotalPages
    TotalPages=RS.PageCount
    If CurPage>RS.Pagecount Then
    CurPage=RS.Pagecount
    end if
    RS.AbsolutePage=CurPage
    rs.CacheSize=RS.PageSize
    Dim Totalcount
    Totalcount=INT(RS.recordcount)
    %>
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td> &
    共有<%=Totalcount%>条帖子,共<%=TotalPages%>页,
    目前为第<font color="#CC0000"><%=CurPage%>
    </font>页</td><td align="right">
    <A HREF="addnew.asp?owner=<%=owner%>">
    <IMG SRC="../images/ty.GIF"
    WIDTH="59" HEIGHT="21" BORDER="0"></A>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href=bbs.asp?owner=<%=owner%>>[ 刷 新]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=Curpage-1%>>[上一页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=Curpage+1%>>[下一页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=1>
    [首页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=TotalPages%>>尾页</a>&nbsp;
    </td></tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
    <tr><td>
    <table width=100% border=0 cellspacing=1 cellpadding=0>
    <tr height=22 bgcolor="#0080c0">
    <td height="25" COLSPAN="2">
    <font color="#FFFFFF">
    <b>&nbsp;&nbsp;&nbsp;文章主题</b></font></td>
    <TD ALIGN="center" WIDTH="30" HEIGHT="25">
    <font color="#FFFFFF"><B>字数</b></font></TD>
    <td align="center" width="90" height="25"><font color="#FFFFFF"><b> 作 &nbsp;&nbsp; 者 </b></font></td>
    <td align="center" width="30" height="25">
    <font color="#FFFFFF"><b>人气</b></font></td>
    <td align="center" height="25" width="130">
    <font color="#FFFFFF">
    <b>发表时间</b></font></td>
    <%I=0
    p=RS.PageSize *(Curpage-1)
    do while (Not RS.Eof) and (II<RS.PageSize)
    p=p+1%>
    <tr>
    <td height="25" bgcolor="#b7d1f4" COLSPAN="2">
    <%i=1
    listtip="&nbsp;"
    do while i<rs("layer")
    listtip=listip & "&nbsp;&nbsp;&nbsp;"
    i=i+1
    loop%>
    <%if i=1 then
    response.write("<font size=3> * </font>")
    else
    response.write("&nbsp;"&listtip)
    end if%>
    <image src=../images/face<%=rs("Face")%>.gif align=absmiddle>&nbsp;<a href=disp.asp?owner=<%=owner%>&ID=<%=rs("ID")%>><%=rs("Topic")%></a>
    <%if rs("txtlong")>0 then%> <%end if%> <%if rs("time")>=date() then response.write("&nbsp;<image src=../image/face.gif align=absmiddle>")%></td>
    <%if rs("click")>=15 and rs("order")=1 then response.write("<font color=DD0000>&nbsp; 热 点</font>")%></td>
    <TD ALIGN=center WIDTH="30" BGCOLOR="#b7d1f4" HEIGHT="25">[<I><%=rs("txtlong")%></I>]</TD>
    <td width="90" bgcolor="#b7d1f4" height="25"><img src="../images/face.gif" width="18" height="13">
    <a href=detail.asp?username=<%=rs(name)%> title="我的资料">
    <%=left(rs("Name"),10)%></a></td>
    <td align=center width="30" bgcolor="#b7d1f4" height="25">[<%=rs("Click")%>]</td>
    <td width="130" bgcolor="#b7d1f4" height="25">
    <%=rs("time")%></td>
    </tr>
    <%rs.movenext
    II=II+1
    loop%>
    </table>
    </td></tr></table>
    <%StartPageNum=1
    do while StartPageNum+15<=CurPage
    StartPageNum=StartPageNum+15
    Loop
    EndPageNum=StartPageNum+14
    If EndPageNum>RS.Pagecount then
    EndPageNum=RS.Pagecount
    %>
    <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
    <tr> <td> @ 页次: <font color="#CC0000">
    <%=CurPage%></font>/<%=TotalPages%>,
    每页:<font color="#CC0000">
    <%=RS.PageSize%></font> 贴
    </td><td align="right"> 页 数 : <a href="bbs.asp?owner=<%=owner%>&CurPage=<%=StartPageNum-1%>"></a>
    <a href="bbs.asp?owner=<%=owner%>&CurPage=
    <%=StartPageNum-1%>"><<</a>
    <% For I=StartPageNum to EndPageNum
    if I<>CurPage then
    End if
    %>
    <a href="bbs.asp?owner=<%=owner%>&CurPage=
    <%=I%>">[<%=I%>]</a>
    Next else <font color="#CC0000"><b><%=I%></b></font>End if</End><%Next%>
    <% if EndPageNum<RS.Pagecount then %><a href="bbs.asp?owner=<%=owner%>&CurPage=<%=EndPageNum+1%>">[更多...]</a>
    <%end if%></tr></table>
    <%else%>
    暂时无帖子,请
    <a href="addnew.asp?owner=<%=owner%>"><b>添 加 新 帖 子 </b></a>
    <%end if%> </form>
    <div align="center">
    <p><font color="#999999"><%=bbscomment%></font>
    <br><br><br></p></div>
    </body>
    </html>
    <%
    rs.close
    第176行 :set rs=nothing
    %>

    错误提示如下:

  • 错误类型:
    Microsoft VBScript 编译器错误 (0x800A03F6)
    缺少 'End'
    /club/bbs.asp, 第 176 行

  • 浏览器类型:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)

  • 网页:
    GET /club/bbs.asp



    请问如何解决?
  • [此贴子已经被作者于2006-1-18 13:01:47编辑过]


    一个新手,但是是一个asp的爱好者,希望大家帮忙!
    2006-01-18 12:57
    rainic
    Rank: 6Rank: 6
    等 级:贵宾
    威 望:27
    帖 子:2367
    专家分:0
    注 册:2005-8-9
    收藏
    得分:0 
    你本来是这样的嘛 
    第145行:If EndPageNum>RS.Pagecount
    then EndPageNum=RS.Pagecount

    改成
    If EndPageNum>RS.Pagecount then
    EndPageNum=RS.Pagecount


    2006-01-18 12:59
    gesila990
    Rank: 1
    等 级:新手上路
    帖 子:42
    专家分:0
    注 册:2006-1-5
    收藏
    得分:0 
    那新的问题是那个阿?怎么解决?

    一个新手,但是是一个asp的爱好者,希望大家帮忙!
    2006-01-18 13:04
    rainic
    Rank: 6Rank: 6
    等 级:贵宾
    威 望:27
    帖 子:2367
    专家分:0
    注 册:2005-8-9
    收藏
    得分:0 
    还是刚才那,改成
    If EndPageNum>RS.Pagecount then
    EndPageNum=RS.Pagecount
    end if

    2006-01-18 13:08
    gesila990
    Rank: 1
    等 级:新手上路
    帖 子:42
    专家分:0
    注 册:2006-1-5
    收藏
    得分:0 

    问题还是存在,全部代码:
    <%
    dim conn,rs
    dim owner,id,topid,layer,order
    dim CurPage
    If Request.QueryString("CurPage")= "" or Request.QueryString("CurPage") = 0 then
    CurPage =1
    Else
    CurPage = CINT(Request.QueryString("CurPage"))
    End If

    owner=request.querystring("owner")
    id=request.querystring("id")
    topid=request.querystring("topid")
    layer=request.querystring("layer")
    order=request.querystring("order")
    page=request.querystring("page")

    set conn=server.createobject("adodb.connection")
    DBPath=Server.MapPath("../data/bbs.mdb")
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
    set rsuser=server.createobject("adodb.recordset")
    sql="Select * From User Where User='" & owner & "'"
    response.write sql
    第24行:rs.open sql,conn,0,1
    dim bbsname
    bbsname=rsuser("subject")
    rsuser.close
    set rsuser=nothing
    %>
    <html>
    <head>
    <title> @ 论坛 - <%=bbsname%></title>
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312">
    <style type=text/css><!--td {font family:宋体;font-szie:9pt}body{ font-family:宋体;font-size:9pt}select{ font-family:宋体;font-size:9pt}A{text-decoration:none;font-family:宋体;font-size:9pt}A:hover{text-decoration:underline;color:#CC0000;font-family:"宋体";font-size:9pt};big{font-family:宋体;font-size:12pt}
    --></style>
    </head>
    <body text="#000000" vlink="#330099"
    link="#3300CC"topmargin="2"
    background="#000000">
    <form action=bbs.asp method=get>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td align="left" height="20" width="35%">
    <p align="left"><b>版主:</b></p>
    </td>
    <td align="right" height="20" width="65%"><b>|</b>
    <a href="home.asp">社区首页</a><b>|</b>
    <a href="Bank/Index.asp">银行</a><b>|</b>
    <a href="bet/index.asp">赌场</a><b>|</b>
    <a href="regusers.asp">排行榜</a><b>|</b>
    <a href="good.asp?owner=<%=owner%>"> 精 华 版 </a><b>|</b>
    <a href="../Reg/register.htm"> 注 册 </a></b><b>|</b></b>
    <a href="help.htm"target="_blank"></b></b>
    <a href="logout.asp"> 离 开 </a></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="3">
    , <tr><td><span class="big">
    <b><img src="../images/tty.GIF" width="23" height="18"><%=bbsname%></b></span><br>
    </td> </tr>
    </table>
    <%rs.open "SELECT * FROM bbs WHERE Owner='" & owner & "' ORDER BY LastTime DESC,TopID DESC,[Order]",Conn,1,1
    if not rs.eof and not rs.bof then
    RS.PageSize=30
    Dim TotalPages
    TotalPages=RS.PageCount
    If CurPage>RS.Pagecount Then
    CurPage=RS.Pagecount
    end if
    RS.AbsolutePage=CurPage
    rs.CacheSize=RS.PageSize
    Dim Totalcount
    Totalcount=INT(RS.recordcount)
    %>
    <table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td> &
    共有<%=Totalcount%>条帖子,共<%=TotalPages%>页,
    目前为第<font color="#CC0000"><%=CurPage%>
    </font>页</td><td align="right">
    <A HREF="addnew.asp?owner=<%=owner%>">
    <IMG SRC="../images/ty.GIF"
    WIDTH="59" HEIGHT="21" BORDER="0"></A>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href=bbs.asp?owner=<%=owner%>>[ 刷 新]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=Curpage-1%>>[上一页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=Curpage+1%>>[下一页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=1>
    [首页]</a>&nbsp;
    <a href=bbs.asp?owner=<%=owner%>&Curpage=
    <%=TotalPages%>>尾页</a>&nbsp;
    </td></tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
    <tr><td>
    <table width=100% border=0 cellspacing=1 cellpadding=0>
    <tr height=22 bgcolor="#0080c0">
    <td height="25" COLSPAN="2">
    <font color="#FFFFFF">
    <b>&nbsp;&nbsp;&nbsp;文章主题</b></font></td>
    <TD ALIGN="center" WIDTH="30" HEIGHT="25">
    <font color="#FFFFFF"><B>字数</b></font></TD>
    <td align="center" width="90" height="25"><font color="#FFFFFF"><b> 作 &nbsp;&nbsp; 者 </b></font></td>
    <td align="center" width="30" height="25">
    <font color="#FFFFFF"><b>人气</b></font></td>
    <td align="center" height="25" width="130">
    <font color="#FFFFFF">
    <b>发表时间</b></font></td>
    <%I=0
    p=RS.PageSize *(Curpage-1)
    do while (Not RS.Eof) and (II<RS.PageSize)
    p=p+1%>
    <tr>
    <td height="25" bgcolor="#b7d1f4" COLSPAN="2">
    <%i=1
    listtip="&nbsp;"
    do while i<rs("layer")
    listtip=listip & "&nbsp;&nbsp;&nbsp;"
    i=i+1
    loop%>
    <%if i=1 then
    response.write("<font size=3> * </font>")
    else
    response.write("&nbsp;"&listtip)
    end if%>
    <image src=../images/face<%=rs("Face")%>.gif align=absmiddle>&nbsp;<a href=disp.asp?owner=<%=owner%>&ID=<%=rs("ID")%>><%=rs("Topic")%></a>
    <%if rs("txtlong")>0 then%> <%end if%> <%if rs("time")>=date() then response.write("&nbsp;<image src=../image/face.gif align=absmiddle>")%></td>
    <%if rs("click")>=15 and rs("order")=1 then response.write("<font color=DD0000>&nbsp; 热 点</font>")%></td>
    <TD ALIGN=center WIDTH="30" BGCOLOR="#b7d1f4" HEIGHT="25">[<I><%=rs("txtlong")%></I>]</TD>
    <td width="90" bgcolor="#b7d1f4" height="25"><img src="../images/face.gif" width="18" height="13">
    <a href=detail.asp?username=<%=rs(name)%> title="我的资料">
    <%=left(rs("Name"),10)%></a></td>
    <td align=center width="30" bgcolor="#b7d1f4" height="25">[<%=rs("Click")%>]</td>
    <td width="130" bgcolor="#b7d1f4" height="25">
    <%=rs("time")%></td>
    </tr>
    <%rs.movenext
    II=II+1
    loop%>
    </table>
    </td></tr></table>
    <%StartPageNum=1
    do while StartPageNum+15<=CurPage
    StartPageNum=StartPageNum+15
    Loop
    EndPageNum=StartPageNum+14
    If EndPageNum>RS.Pagecount then
    EndPageNum=RS.Pagecount
    end if
    %>
    <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
    <tr> <td> @ 页次: <font color="#CC0000">
    <%=CurPage%></font>/<%=TotalPages%>,
    每页:<font color="#CC0000">
    <%=RS.PageSize%></font> 贴
    </td><td align="right"> 页 数 : <a href="bbs.asp?owner=<%=owner%>&CurPage=<%=StartPageNum-1%>"></a>
    <a href="bbs.asp?owner=<%=owner%>&CurPage=
    <%=StartPageNum-1%>"><<</a>
    <% For I=StartPageNum to EndPageNum
    if I<>CurPage then
    End if
    %>
    <a href="bbs.asp?owner=<%=owner%>&CurPage=
    <%=I%>">[<%=I%>]</a>
    Next else <font color="#CC0000"><b><%=I%></b></font>End if</End><%Next%>
    <% if EndPageNum<RS.Pagecount then %><a href="bbs.asp?owner=<%=owner%>&CurPage=<%=EndPageNum+1%>">[更多...]</a>
    <%end if%></tr></table>
    <%else%>
    暂时无帖子,请
    <a href="addnew.asp?owner=<%=owner%>"><b>添 加 新 帖 子 </b></a>
    <%end if%> </form>
    <div align="center">
    <p><font color="#999999"><%=bbscomment%></font>
    <br><br><br></p></div>
    </body>
    </html>
    <%
    rs.close
    set rs=nothing
    %>

    错误提示如下:

  • 错误类型:
    Microsoft VBScript 运行时错误 (0x800A01A8)
    缺少对象: ''
    /club/bbs.asp, 第 24 行

  • 浏览器类型:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)

  • 网页:
    GET /club/bbs.asp

  • 一个新手,但是是一个asp的爱好者,希望大家帮忙!
    2006-01-18 15:41
    rainic
    Rank: 6Rank: 6
    等 级:贵宾
    威 望:27
    帖 子:2367
    专家分:0
    注 册:2005-8-9
    收藏
    得分:0 
    sql="Select * From User Where User='" & owner & "'"
    改成:
    sql="Select * From [User] Where [User]='" & owner & "'"

    2006-01-18 16:01
    gesila990
    Rank: 1
    等 级:新手上路
    帖 子:42
    专家分:0
    注 册:2006-1-5
    收藏
    得分:0 




    修改后出现以下内容:

  • 错误类型:
    Microsoft VBScript 运行时错误 (0x800A01A8)
    缺少对象: ''
    /club/bbs.asp, 第 24 行

  • 浏览器类型:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)

  • 网页:
    GET /club/bbs.asp

  • 一个新手,但是是一个asp的爱好者,希望大家帮忙!
    2006-01-18 16:12
    rainic
    Rank: 6Rank: 6
    等 级:贵宾
    威 望:27
    帖 子:2367
    专家分:0
    注 册:2005-8-9
    收藏
    得分:0 
    sql="Select * From User Where User='" & owner & "'"
    response.write sql '这里输出了什么?
    第24行:rs.open sql,conn,0,1

    2006-01-18 16:20
    快速回复:[求助]问个asp的问题?
    数据加载中...
     
       



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

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