请教asp问题 被零除

问题描述

MicrosoftVBScript运行时错误错误'800a000b'被零除/news.asp,行183------------------------下面是代码。在dream8看的的183行的代码【<%functionshowpage(totalnumber,maxperpage,filename)dimn,iiftotalnumbermodmaxperpage=0thenn=totalnumbermaxperpageelsen=totalnumbermaxperpage+1endifresponse.write"<formmethod=postname=myformaction=ru_query.asp>"response.write"<tralign=center><tdbgcolor=#eeeeeecolspan=3fontcolor=#333333>"ifCurrentPage<2thenresponse.write"共有"&totalnumber&"篇文章|首页|上一页|"elseresponse.write"共有"&totalnumber&"篇文章|<ahref="&filename&"?page=1>首页</a>|"response.write"<ahref="&filename&"?page="&CurrentPage-1&">上一页</a>|"endififn-currentpage<1thenresponse.write"下一页|尾页|"elseresponse.write"<ahref="&filename&"?page="&(CurrentPage+1)&">"response.write"下一页</a>|<ahref="&filename&"?page="&n&">尾页</a>|"endifresponse.write"页次:"&CurrentPage&"/"&n&"页|"response.write""&maxperpage&"篇页"】------------------------------下面是整套源码----------------------------------------------------

解决方案

解决方案二:
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>新闻资讯域名抢注域名交易域名注册包你发b08.com</title><metacontent="域名抢注域名交易域名注册包你发b08.com"name="keywords"><metacontent="域名抢注域名交易域名注册包你发b08.com"name="description"><linkhref="/images/b08.css"rel="stylesheet"type="text/css"><style>#newmainlistli{width:290px;overflow:hidden;text-overflow:ellipsis;text-decoration:none;}#tNews{font-family:微软雅黑,黑体;font-size:18px;color:#000000;}#tNewsli{width:370px;overflow:hidden;text-overflow:ellipsis;text-decoration:none;padding:5px0px0px5px;}#tNewsa{color:#000000;}</style><scriptsrc="/table.js"></script><!--#includefile="Conn.asp"--><%dimrs,sqldimtotalPutdimCurrentPage,TotalPagesifnotisempty(request("page"))thencurrentPage=cint(request("page"))elsecurrentPage=1endifsetrs=server.createobject("adodb.recordset")%></head><body><tablewidth="986"cellspacing="0"cellpadding="0"align="center"id="topbar"border="0"><tr><tdalign="center"rowspan="3"width="150"><imgsrc="/images/search_img.png"></Td><tdid="menulist"height="40"><ahref="/"class="hot">已备案域名</a><ahref="/index.asp?gxz=yahoo">高外链域名</a><ahref="/index.asp?gxz=pr">高pr域名</a><ahref="/domain/">域名注册</a><!--<ahref="/domainpark/">域名停放</a>--><ahref="#">域名资讯</a><ahref="/user/index.asp">会员中心</a><ahref="/down/">资源下载</a><ahref="/about.asp">关于我们</a></td></tr><tr><tdheight="31"valign="top"><tablecellspacing="0"cellpadding="0"><formaction="/index.asp"name="searchForm"target="_blank"><tr><td><divclass="topinput"><selectname="types"><optionvalue="whois">Whois信息查询</option></select><inputtype="text"size="70"name="query"value=""></div></td><td>&nbsp;<inputtype="submit"value="搜索"class="bt2"></td></tr></form></table></td></tr><tr><tdvalign="top"height="21"></td></tr></table><scriptsrc="/js/pngfix.js"></script><styletype="text/css">.divSlt{position:absolute;font-size:12px;}.divSltspan{display:block;width:100%;background:url(/images/n/td.gif)rightcenterno-repeat;text-indent:6px;cursor:pointer;margin-top:2px;padding-top:2px;}.divSltul{display:block;background-color:#FFFFFF;width:100%;border:2pxsolid#4E8DBB;border-top:0px;margin:0px;padding:0px;list-style:none;}.divSltulli{text-indent:5px;height:20px;line-height:20px;cursor:pointer;}</style><scriptsrc="/js/select.js"></script><script>instSelect(document.searchForm.types);</script><divid="homelink">当前位置:<ahref="/">首页</a>-新闻中心</div><divid="main"><tablewidth="100%"cellpadding="0"cellspacing="0"border="0"><tr><!--左--><tdvalign="top"><tablewidth="100%"border="0"align="center"cellpadding="0"cellspacing="10"><tr><tdheight="16"><TABLEwidth="100%"border=0align="center"cellPadding=4cellSpacing=1bgcolor="#CCCCCC"class="table"><tralign="center"><tdwidth="18"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>ID</strong></font></td><tdwidth="386"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>新闻标题</strong></font></td><tdwidth="75"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>阅读次数</strong></font></td><tdwidth="95"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>添加者</strong></font></td><tdwidth="100"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>文章来源</strong></font></td><tdwidth="100"bgcolor="#f7f7f7"><fontcolor="#333333"><strong>添加日期</strong></font></td></tr><TRbgcolor="#FFFFFF"><TDcolspan="6"><%sql="select*fromarticleorderbyarticleiddesc"rs.opensql,conn,1,1ifrs.eofandrs.bofthenresponse.write"<palign='center'>没有找到任何文章</p>"elsetotalPut=rs.recordcountifcurrentpage<1thencurrentpage=1endifif(currentpage-1)*MaxPerPage>totalputthenif(totalPutmodMaxPerPage)=0thencurrentpage=totalPutMaxPerPageelsecurrentpage=totalPutMaxPerPage+1endifendififcurrentPage=1thenshowContentshowpagetotalput,MaxPerPage,"index.asp"elseif(currentPage-1)*MaxPerPage<totalPutthenrs.move(currentPage-1)*MaxPerPageshowContentshowpagetotalput,MaxPerPage,"index.asp"elsecurrentPage=1showContentshowpagetotalput,MaxPerPage,"index.asp"endifendifrs.closeendifsubshowContentdimii=0dowhilenotrs.eof%><tr><tdwidth="18"align="center"bgcolor="#FFFFFF"class="hittd"><b><%=i+1%></b></td><tdwidth="386"bgcolor="#FFFFFF"><fontcolor="#333333"><ahref="news.asp?id=<%=rs("articleid")%>"target="_blank"title="<%=rs("title")%>"><%=rs("title")%></a></font></td><tdwidth="75"align="center"bgcolor="#FFFFFF"class="hittd"><fontcolor="#333333"><%=rs("hits")%></font></td><tdwidth="95"align="center"bgcolor="#FFFFFF"><fontcolor="#333333"><%ifnotisnull(rs("writer"))then%><%=rs("writer")%><%else%>不详<%endif%></font></td><tdwidth="100"align="center"bgcolor="#FFFFFF"class="hittd"><%=rs("writefrom")%></td><tdwidth="100"align="center"bgcolor="#FFFFFF"class="hittd"><fontcolor="#333333"><%ifrs("dateandtime")=date()then%><%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%><%else%><%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%><%endif%></font></td></tr><%i=i+1ifi>=MaxPerPagethenexitdors.movenextloopendsub%></table>
解决方案三:
<spanclass="font"><%functionshowpage(totalnumber,maxperpage,filename)dimn,iiftotalnumbermodmaxperpage=0thenn=totalnumbermaxperpageelsen=totalnumbermaxperpage+1endifresponse.write"<formmethod=postname=myformaction=ru_query.asp>"response.write"<tralign=center><tdbgcolor=#eeeeeecolspan=3fontcolor=#333333>"ifCurrentPage<2thenresponse.write"共有"&totalnumber&"篇文章|首页|上一页|"elseresponse.write"共有"&totalnumber&"篇文章|<ahref="&filename&"?page=1>首页</a>|"response.write"<ahref="&filename&"?page="&CurrentPage-1&">上一页</a>|"endififn-currentpage<1thenresponse.write"下一页|尾页|"elseresponse.write"<ahref="&filename&"?page="&(CurrentPage+1)&">"response.write"下一页</a>|<ahref="&filename&"?page="&n&">尾页</a>|"endifresponse.write"页次:"&CurrentPage&"/"&n&"页|"response.write""&maxperpage&"篇页"response.write"</td><tdcolSpan=3bgColor=#eeeeee><tablewidth=80%border=0cellspacing=0cellpadding=0cellpadding=1align=center><tr><tdalign=center>"response.write"新闻搜索:<inputtype=textname=keywordsize=15maxlength=50class=inputstyle='font-size:9pt;height:18;width:101'></td><tdalign=center>"response.write"<inputname=Submittype=imagesrc=images/search.gif></td></tr></table>"response.write"</td></tr>"response.write"</form>"%></span><%endfunctionsetrs=nothingconn.closesetconn=nothing%></td></tr></table></td><tdvalign="top"width="190"><divid="f1"><divid="fTitle"><ul><li><imgsrc="/images/comment_add.gif"align="absmiddle">&nbsp;<ahref="http://www.itbeian.com"class="redfont">备案米库</a>注册用户请登陆:</li></ul></div><divid="fMain"><style>.lli{padding:7px0px3px10px;}</style><scriptlanguage="JavaScript"><!--functionshowCodeimg(){if(document.all.logincodeinput.style.display!='')document.all.codeimg.src='verifypic.asp';document.all.logincodeinput.style.display='';}//--></script><%ifSession("user")=""then%><formmethod="post"action="user/login.asp?action=login"onsubmit="returnCheckForm(this)"><tablealign="center"><tr><td>用户名:</td><td><inputtype="text"name="username"class="inputstyle"size="15"onFocus="showCodeimg()"></td></tr><tr><td>密 码:</td><td><inputtype="password"name="password"class="inputstyle"size="15"></td></tr><trid="logincodeinput"style="display:none"><td>验证码:</td><td><inputtype="text"class="inputstyle"name="code"size="5"><imgsrc="images/loading.gif"id="codeimg"width="56"height="20"align="absmiddle"></td></tr><tr><inputname="dl"type="hidden"value="1"><td>&nbsp;</td><tdheight="35"><inputtype="submit"value="登陆"style="width:110px;"class="bt1"></td></tr><tr><tdcolspan="2"align="center"><ahref="/user/reg.asp">注册新用户</a></td></tr></table></form><%else%><ulclass="l"><%setrs=server.CreateObject("adodb.recordset")rs.Open"select*from[dl_user]whereusername='"&Session("user")&"'",conn,1,3jine=rs("jine")viptime=rs("viptime")rs.Closesetrs=nothing%><li>欢迎您,<%=Session("user")%></li><%ifviptime>now()then%><li>帐户类型:VIP用户</li><%else%><li>帐户类型:普通用户<imgsrc='images/u.gif'align='absmiddle'><ahref='user/pay.asp'class='redfont'target='_blank'>升级</a></li><%endif%><li>可用资金:<%=jine%>元</li><li><ahref="/user/">进入控制中心</a></li><li><ahref="/user/out.asp">退出登陆</a></li></ul><%endif%></div><divid="fBottom"><ul><li></li></ul></div></div><divid="f2"><divid="fTitle"><ul><li>快速搜索</li></ul></div><divid="fMain"><formname="form2"method="post"action="index.asp">备案网站名称:<inputname="webname"class="inputstyle"size="10"><br>备案主办名称:<inputname="icpname"class="inputstyle"size="10"><center><inputtype="submit"value="搜索"class="bt1"></center></form><br><ulid="rList"><li><ahref=/index.asp?czm=2&ExtName=.com>纯字母com域名</a></li><li><ahref=/index.asp?czm=1&ExtName=.com>纯数字com域名</a></li><li><ahref=/index.asp?czm=2&ExtName=.cn>纯字母cn域名</a></li><li><ahref=/index.asp?czm=1&ExtName=.cn>纯数字cn域名</a></li></ul></div><divid="fBottom"><ul><li></li></ul></div></div><divid="f2"><divid="fTitle"><ul><li>使用帮助</li></ul></div><divid="fMain"><ulid="rList"><li>常见问题</li><li>使用帮助</li><li>预定说明</li><li><atarget="_blank"href="http://wpa.qq.com/msgrd?v=3&uin=2210792188&site=qq&menu=yes"><imgsrc="http://www.nicenic.com/images/c.gif"align="absmiddle"border="0">在线交谈</a></li><li></li></ul><ahref="http://www.22.cn/?source=26611"target="_blank"><imgsrc="http://www.22.cn/images/tuiguang/120x240.gif"border="0"></a></div><divid="fBottom"><ul><li></li></ul></div></div></td><!--右--></tr></table><br/></div><!--#includefile="end.asp"--><divstyle="color:#ffffff;position:absolute;top:-100px;left:-1000px;"></div></body></html>
解决方案四:
totalnumber和maxperpage有问题吧,要加个判断要是数据库为空,totalnumber和maxperpage都是0,0/0就出错了
解决方案五:
在相关的地方,显示相关的值,就应该知道的了。

时间: 2024-08-04 02:15:11

请教asp问题 被零除的相关文章

asp.net-小白请教ASP.NET下引用出现的一个问题~

问题描述 小白请教ASP.NET下引用出现的一个问题~ 如图,为何出错?右边我实体里建了同名类文件了啊~ 解决方案 不同的项目,要先在项目-添加引用添加那个项目 然后检查命名空间对不对 还不行,先编译下 解决方案二: 先在项目-添加引用添加那个项目

asp.net放贷计算代码-请教asp.net中放贷计算代码

问题描述 请教asp.net中放贷计算代码 asp.net放贷计算代码asp.net放贷计算代码asp.net放贷计算代码asp.net放贷计算代码 解决方案 google下就有.房贷写错了,这影响你搜索结果的相关性 随便找一个http://download.csdn.net/download/cxd19880708/4039426 别的你也可以自己找.总之,学会自己google.

asp.net-菜鸟请教ASP.NET MVC 视图怎么接受控制传过来的值

问题描述 菜鸟请教ASP.NET MVC 视图怎么接受控制传过来的值 解决方案 比如要获得Message @Model.Message 解决方案二: 控制器传值过去指定的视图,视图要调用直接 Model.** 就行了

[请教]ASP.NET企业级开发有那些设计原则?

问题描述 上个项目快结束的时候遇到一个这样的问题:1,一个页面用到Frameset,上下分开,上面的Frame是一排按钮(第三方控件生成),用户点击后,保存并关闭窗口;下面的Frame主要是输入框,用来收集用户的数据,并使用了AJAX(前台onblur事件触发),提交到服务端进行必要的验证.2,按照设计,应该是所有的数据都校验完毕后,用户才能点击保存按钮,但实际上是还没等到AJAX处理完成(数据量比较大,处理时间有些长),用户就已点击了保存按钮.因为最终无法完成全部数据的校验,保存也就跟着失败了

请教ASP.NET 如何在客户端根据获取变量执行不同的操作!

问题描述 大家好!我知道在客户端可以通过<%#Eval("SortID")%>的方式获取到邦定的数据SortID如果sortID的值只有两种可能,1或者是0,那次是我可以用"?:"运算符来操作但是如果我SortID有3个,或4个值!那我该如何操作?我知道可以在客户端写下面的代码:<%switch(sortID)case1:Response.Write("图1");brake;case2:Response.Write("

新手请教ASP.NET

问题描述 我是刚接触ASP.NET这门技术的,请各位介绍些什么资料(书.视频),非常感谢! 解决方案 解决方案二:是否能播放若不能播放需安装AdobeFlashPlayer解决方案三:aspnet揭秘解决方案四:去www.w3school.com.cn看看,里面都是些教程,挺全的解决方案五:源码到51aspx资料可以看看博客园和到电驴下载解决方案六:多看一些开源项目!一切OK解决方案七:边看书,边实践,多动手.主要是思想解决方案八:<C#入门经典>在来本实践的书.配合学习C#入门很快解决方案九

请教ASP.NET网页中错误信息显示设置的问题

问题描述 这是一段示例代码,当校验控件满足错误条件时,显示错误信息<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox><asp:RangeValidatorID="RangeValidator1"runat="server"ErrorMessage="请输入范围在10~20之间的数值"ControlToValidate=&

请教asp.net与javascript之间的问题!

问题描述 在asp.net中为了一次能上传多个文件,且为了界面的美观,我采用了以一个input型button控件来调用inputfile.为了将inputfile控件的值传回后台,定义了一个Hidden控件来保存inputfile中获得的路径.这部分代码如下:<inputid="BtnOpenFileChoose"runat="Server"onclick="CallFileUpload();"type="button"

[请教] asp.net对数据倒入excel文件的问题?

问题描述 是这样,做一个web程序,实现用excel进行批量倒入的功能.现在写了一部分代码,有问题不知道怎么写下去啦!请各位高手帮忙!代码如下:Label1.Text=this.File1.PostedFile.FileName;stringexcelstr=Label1.Text.ToString().Trim();stringmystring="Provider=Microsoft.Jet.OLEDB.4.0;DataSource='"+excelstr+"';Exten