CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
(图)邪恶的韩国UMPC 使用 Java 编写数据库应用新规范
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

请各位高手指教,小妹在此谢过!!!(急!)

楼主SUPERHANDY(湖里糊徒)2002-10-18 15:21:11 在 Web 开发 / ASP 提问

<%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>  
  <html>  
  <head>  
  <title>饿饿额</title>  
  <%      
          const   MaxPerPage=10  
  %>  
  <STYLE   type=text/css>  
  :link   {  
  COLOR:   #0066FF;   FONT-SIZE:   35px;   TEXT-DECORATION:   none  
  }  
  :visited   {  
  COLOR:   #009966;   FONT-SIZE:   35px;   TEXT-DECORATION:   none  
  }  
  :active   {  
  FONT-SIZE:   35px;   TEXT-DECORATION:   underline  
  }  
  :hover   {  
  COLOR:   #5390bd;   FONT-SIZE:   35px;   TEXT-DECORATION:   underline  
  }  
  </STYLE>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <script   language="JavaScript"   type="text/JavaScript">  
  <!--  
  function   MM_reloadPage(init)   {     //reloads   the   window   if   Nav4   resized  
      if   (init==true)   with   (navigator)   {if   ((appName=="Netscape")&&(parseInt(appVersion)==4))   {  
          document.MM_pgW=innerWidth;   document.MM_pgH=innerHeight;   onresize=MM_reloadPage;   }}  
      else   if   (innerWidth!=document.MM_pgW   ||   innerHeight!=document.MM_pgH)   location.reload();  
  }  
  MM_reloadPage(true);  
  //-->  
  </script>  
  </head>  
   
  <body>  
   
  <div   id="Layer1"   style="position:absolute;   left:0px;   top:0px;   width:90px;   height:74px;   z-index:1"><img   src="file:///C|/inetpub/wwwroot/access/form.jpg"   width="1024"   height="768"></div>  
  <div   id="Layer2"   style="position:absolute;   left:120px;   top:17px;   width:854px;   height:59px;   z-index:2">  
      <table   width="850"   border="1"   cellspacing="0"   cellpadding="0"   bordercolor="#FFFFFF"   bgcolor="#EEEEEE"   align="center">  
          <tr   bgcolor="#FFCC99">    
              <th   height="40"><div   align="center"><font   face="仿宋_GB2312"></font><font   face="仿宋_GB2312"></font><font   face="仿宋_GB2312"></font></div>  
                  <font   face="仿宋_GB2312">收费项目</font></th>  
              <th   width="191"><div   align="center"><font   face="仿宋_GB2312">计费单位</font></div></th>  
              <th   width="164"><div   align="center"><font   face="仿宋_GB2312">收费标准</font></div></th>  
              <th><div   align="center"><font   face="仿宋_GB2312">收费依据</font></div>  
                  </th>  
              <th   width="99"><div   align="center"><font   face="仿宋_GB2312">备注</font></div></th>  
          </tr>  
          <%  
  objconn="DBQ="+server.MapPath("wjcx.mdb")+";DefaultDir=;DRIVER={Microsoft   Access   Driver   (*.mdb)};"  
  set   rs=server.createobject("adodb.recordset")  
  sql="select   *   from   有线电视"  
  rs.open   sql,objconn,1,1  
   
  rs.PageSize=MaxPerPage  
  if   trim(request("Page"))<>""   then  
  CurrentPage=CLng(request("Page"))  
  if   CurrentPage>rs.PageCount   then  
  CurrentPage=rs.PageCount  
  end   if  
  else  
  CurrentPage=1  
  end   if  
   
  if   rs.eof   and   rs.bof   then  
  Response.Write   "<p   align='center'>ERROR!</p>"  
  else  
   
                  totalPut=rs.RecordCount  
  if   CurrentPage<>1   then  
  if   (CurrentPage-1)*MaxPerPage<totalPut   then  
  rs.Move(CurrentPage-1)*MaxPerPage  
  bookmark=rs.Bookmark  
  end   if  
  end   if  
  if   (totalPut   mod   MaxPerPage)=0   then  
  n=totalPut\MaxPerPage  
  else  
  n=totalPut\MaxPerPage+1  
  end   if  
  %>  
          <%  
  j   =   0  
  while   not   rs.eof   and   j<MaxPerPage  
  %>  
          <tr   bgcolor="#FFCC99">    
              <td><div   align="center"></div>  
                  <div   align="center"><%=rs("收费项目")%></div>  
                  <div   align="center"></div></td>  
              <td   height="50"><div   align="center"><%=rs("计费单位")%></div></td>  
              <td   height="50"><div   align="center"><%=rs("收费标准")%></div></td>  
              <td   height="50"><div   align="center"></div>  
                  <div   align="center"><%=rs("收费依据")%></div></td>  
              <td   height="50"><div   align="center"><%=rs("备注")%></div></td>  
          </tr>  
          <%    
  j   =   j   +   1  
  rs.movenext  
  wend  
  %>  
      </table>  
  </div>  
  <div   id="Layer3"   style="position:absolute;   left:123px;   top:673px;   width:790px;   height:65px;   z-index:3">  
      <table   width="100%">  
          <tr>    
              <td   align="center"><p><BR>  
                      <%  
  if   CurrentPage<>1   then  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page=1'>首页</a></b>]"  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page="+CStr(CurrentPage-1)+"'>上页</a></b>]"  
  else  
  Response.Write   "[首页][上页]"  
  end   if  
  if   CurrentPage<>n   then  
  Response.Write   "[<b>"+"<a   href='yxdsasp?page="+CStr(CurrentPage+1)+"'>下页</a></b>]"  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page="+CStr(n)+"'>末页</a></b>]"  
  else  
  Response.Write   "[下页][末页]"  
  end   if  
  %>  
                      &nbsp;&nbsp;当前页:<%=CurrentPage%>&nbsp;&nbsp;总页数:<%=n%>&nbsp;&nbsp;   返回</p>  
                  </td>  
          </tr>  
      </table>  
      <p   align="right">&nbsp;</p>  
  </div>  
  <%  
  end   if          
  rs.close  
  set   rs=nothing  
  %>  
   
  </body>  
  </html>  
   
   
   
   
   
  上面是我   的程序代码,我现在的问题是:第一次运行能通过,但是不能刷新,一刷新就返回:/shat/ylfw.asp,   第   53   行,也就是rs.open   sql,objconn,1,1错!还有上页下页连接时也报同样的信息,但是我隔一段时间点击上页下页连接时又正常,这是什么原因呢?  
   
  问题点数:50、回复次数:8Top

1 楼qiangtian(tq)回复于 2002-10-18 15:32:45 得分 0

ft  
  太长了Top

2 楼cglitian(cg_litian)回复于 2002-10-18 15:46:30 得分 0

你在刷新时,把SQL显示出来看看,Top

3 楼superguang(阳光的光)回复于 2002-10-18 15:52:24 得分 5

rs.open   sql,objconn,3,3   就行了   你试试Top

4 楼effun(地瓜)回复于 2002-10-18 15:54:43 得分 0

我的机器也有类似的问题,我也觉得非常奇怪。你在最后把数据库连接关掉试试。  
   
  objconn.close  
  set   objconn   =   nothingTop

5 楼ssm1226(雨中人(虚心学习))回复于 2002-10-18 16:33:38 得分 5

 
   
  加   set   objconn=nothingTop

6 楼liuqinyi(宝贝)回复于 2002-10-18 16:45:11 得分 20

set   rs=server.createobject("adodb.recordset")  
  sql="select   *   from   有线电视"  
  rs.open   sql,objconn,1,1  
  上面是你的代码,你把其中的rs.open   sql,objconn,1,1改成rs.open   sql,objconn,3,1或者是rs.open   sql,objconn,3,3都可以,你没有理解后面两个参数的意思。第三、四个参数是说CursorType,   LockType分别是指游标类型和锁定类型,表明你打开记录集的方式,打开的方式不同会有不同的锁定和游标移动方式。其中cursortype有四种类型  
  adOpenForwardOnly   (Default)   Opens   a   forward-only-type   cursor.  
  adOpenKeyset   Opens   a   keyset-type   cursor.    
  adOpenDynamic   Opens   a   dynamic-type   cursor.    
  adOpenStatic   Opens   a   static   type   cursor.    
  从上面可以看到1是说只是向前,而3的话,你就可以使用动态的游标了。那样既可以向前也可以向后移动了,还有锁定也是我给你贴出来,自己可以看看。  
  adLockReadOnly   (Default)   Read-only   —   you   cannot   alter   the   data.    
  adLockPessimistic   Pessimistic   locking,   record   by   record   —   the   provider   does   what   is   necessary   to   ensure   successful   editing   of   the   records,   usually   by   locking   records   at   the   data   source   immediately   upon   editing.    
  adLockOptimistic   Optimistic   locking,   record   by   record   —   the   provider   uses   optimistic   locking,   locking   records   only   when   you   call   the   Update   method.    
  adLockBatchOptimistic   Optimistic   batch   updates   —   required   for   batch   update   mode   as   opposed   to   immediate   update   mode.  
  Top

7 楼lovelizheng(可可)回复于 2002-10-18 17:42:38 得分 0

三种可能:1.objconn对象本身有问题。  
  2.sql语句有问题。  
  3.objconn对象没有关闭。  
  打开参数应该没问题。Top

8 楼abigfrog(千年精灵)(★JAVA★)回复于 2002-10-18 19:16:27 得分 20

<%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>  
  <html>  
  <head>  
  <title>饿饿额</title>  
  <%      
          const   MaxPerPage=10  
  %>  
  <STYLE   type=text/css>  
  :link   {  
  COLOR:   #0066FF;   FONT-SIZE:   35px;   TEXT-DECORATION:   none  
  }  
  :visited   {  
  COLOR:   #009966;   FONT-SIZE:   35px;   TEXT-DECORATION:   none  
  }  
  :active   {  
  FONT-SIZE:   35px;   TEXT-DECORATION:   underline  
  }  
  :hover   {  
  COLOR:   #5390bd;   FONT-SIZE:   35px;   TEXT-DECORATION:   underline  
  }  
  </STYLE>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <script   language="JavaScript"   type="text/JavaScript">  
  <!--  
  function   MM_reloadPage(init)   {     //reloads   the   window   if   Nav4   resized  
      if   (init==true)   with   (navigator)   {if   ((appName=="Netscape")&&(parseInt(appVersion)==4))   {  
          document.MM_pgW=innerWidth;   document.MM_pgH=innerHeight;   onresize=MM_reloadPage;   }}  
      else   if   (innerWidth!=document.MM_pgW   ||   innerHeight!=document.MM_pgH)   location.reload();  
  }  
  MM_reloadPage(true);  
  //-->  
  </script>  
  </head>  
   
  <body>  
   
  <div   id="Layer1"   style="position:absolute;   left:0px;   top:0px;   width:90px;   height:74px;   z-index:1"><img   src="file:///C|/inetpub/wwwroot/access/form.jpg"   width="1024"   height="768"></div>  
  <div   id="Layer2"   style="position:absolute;   left:120px;   top:17px;   width:854px;   height:59px;   z-index:2">  
      <table   width="850"   border="1"   cellspacing="0"   cellpadding="0"   bordercolor="#FFFFFF"   bgcolor="#EEEEEE"   align="center">  
          <tr   bgcolor="#FFCC99">    
              <th   height="40"><div   align="center"><font   face="仿宋_GB2312"></font><font   face="仿宋_GB2312"></font><font   face="仿宋_GB2312"></font></div>  
                  <font   face="仿宋_GB2312">收费项目</font></th>  
              <th   width="191"><div   align="center"><font   face="仿宋_GB2312">计费单位</font></div></th>  
              <th   width="164"><div   align="center"><font   face="仿宋_GB2312">收费标准</font></div></th>  
              <th><div   align="center"><font   face="仿宋_GB2312">收费依据</font></div>  
                  </th>  
              <th   width="99"><div   align="center"><font   face="仿宋_GB2312">备注</font></div></th>  
          </tr>  
          <%  
  Set   objconn="DBQ="+server.MapPath("wjcx.mdb")+";DefaultDir=;DRIVER={Microsoft   Access   Driver   (*.mdb)};"  
  set   rs=server.createobject("adodb.recordset")  
  sql="select   *   from   有线电视"  
  rs.open   sql,objconn,1,1  
   
  rs.PageSize=MaxPerPage  
  if   trim(request("Page"))<>""   then  
  CurrentPage=CLng(request("Page"))  
  if   CurrentPage>rs.PageCount   then  
  CurrentPage=rs.PageCount  
  end   if  
  else  
  CurrentPage=1  
  end   if  
   
  if   rs.eof   and   rs.bof   then  
  Response.Write   "<p   align='center'>ERROR!</p>"  
  else  
   
                  totalPut=rs.RecordCount  
  if   CurrentPage<>1   then  
  if   (CurrentPage-1)*MaxPerPage<totalPut   then  
  rs.Move(CurrentPage-1)*MaxPerPage  
  bookmark=rs.Bookmark  
  end   if  
  end   if  
  if   (totalPut   mod   MaxPerPage)=0   then  
  n=totalPut\MaxPerPage  
  else  
  n=totalPut\MaxPerPage+1  
  end   if  
  %>  
          <%  
  j   =   0  
  while   not   rs.eof   and   j<MaxPerPage  
  %>  
          <tr   bgcolor="#FFCC99">    
              <td><div   align="center"></div>  
                  <div   align="center"><%=rs("收费项目")%></div>  
                  <div   align="center"></div></td>  
              <td   height="50"><div   align="center"><%=rs("计费单位")%></div></td>  
              <td   height="50"><div   align="center"><%=rs("收费标准")%></div></td>  
              <td   height="50"><div   align="center"></div>  
                  <div   align="center"><%=rs("收费依据")%></div></td>  
              <td   height="50"><div   align="center"><%=rs("备注")%></div></td>  
          </tr>  
          <%    
  j   =   j   +   1  
  rs.movenext  
  wend  
  %>  
      </table>  
  </div>  
  <div   id="Layer3"   style="position:absolute;   left:123px;   top:673px;   width:790px;   height:65px;   z-index:3">  
      <table   width="100%">  
          <tr>    
              <td   align="center"><p><BR>  
                      <%  
  if   CurrentPage<>1   then  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page=1'>首页</a></b>]"  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page="+CStr(CurrentPage-1)+"'>上页</a></b>]"  
  else  
  Response.Write   "[首页][上页]"  
  end   if  
  if   CurrentPage<>n   then  
  Response.Write   "[<b>"+"<a   href='yxdsasp?page="+CStr(CurrentPage+1)+"'>下页</a></b>]"  
  Response.Write   "[<b>"+"<a   href='yxds.asp?page="+CStr(n)+"'>末页</a></b>]"  
  else  
  Response.Write   "[下页][末页]"  
  end   if  
  %>  
                      &nbsp;&nbsp;当前页:<%=CurrentPage%>&nbsp;&nbsp;总页数:<%=n%>&nbsp;&nbsp;   返回</p>  
                  </td>  
          </tr>  
      </table>  
      <p   align="right">&nbsp;</p>  
  </div>  
  <%  
  end   if          
  rs.close  
  set   rs=nothing  
                    objconn.close  
                    set   objconn=nothing    
  %>  
   
  </body>  
  </html>  
  Top

相关问题

  • 如何使页面不执行如下代码??小妹先行谢过各位大虾了。。急等!!!
  • 还是上午那个问题,小妹先谢过各位大哥大姐了!
  • 各位大虾,帮忙看一下一个简单的delphi 问题,小妹谢过!
  • 新手上路:求教查询代码.急急急!!!从数据库中读出生成静态页面。各位有力出力,没力使劲啊。小妹在此先行谢过^_^
  • 紧急求救,望各位相助,先谢过了。
  • 小妹有一个问题,希望哥哥们赐教. 小妹先谢过了:)
  • 请教ASP关于时间的处理??小妹先谢过了~~~
  • 学Oracle的专家,请帮帮小妹,先谢过了!
  • 急!请大虾帮忙!IBM R50e笔记本待机屏幕黑屏,怎么恢复!在线等!小妹先谢过!
  • ¥¥¥¥¥100分求,急啊,急死了,¥¥¥¥¥各位大虾帮帮小妹

关键词

  • 收费
  • thencurrentpage
  • thenresponse
  • currentpage
  • rs

得分解答快速导航

  • 帖主:SUPERHANDY
  • superguang
  • ssm1226
  • liuqinyi
  • abigfrog

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo