| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 342 人关注过本帖
标题:[求助]
只看楼主 加入收藏
ChangLe4
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-7-16
收藏
 问题点数:0 回复次数:2 
[求助]

请问有那一位可以帮我解答一下这个错误,我的库输出语句为什么只能输出一条?可是我库里边不知一条记录,请给予回复。谢谢,我在qq上等候打架;35724308,,谢谢 <!--#include file="conn.asp"--> <% post = Request("post") post = Replace(post,"'","") post = Replace(post," ","") Session("title") = post %> <% set rstxt=server.createobject("adodb.recordset") if post = "" then rstxt.open "select * from product order by id desc ",conn,1,3 Else rstxt.open "select * from product where title='"&Session("title")&"' order by id desc ",conn,1,3 end if %> <html>

<head> <meta http-equiv="Content-Language" content="zh-cn"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>产品信息-广州中宜电子有限公司</title> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; }

function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} }

function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; }

function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style> <!-- body { font-family: 宋体; font-size: 9pt; color: #000000; text-decoration: none } table { font-family: 宋体; font-size: 9pt; color: #000000; text-decoration: none } a:link { font-family: 宋体; font-size: 9pt; text-decoration: none; color: #000000 } a:active { font-family: 宋体; font-size: 9pt; text-decoration: none } a:visited { font-family: 宋体; font-size: 9pt; text-decoration: none } a:hover { font-family: 宋体; font-size: 9pt; color: #FF0000; text-decoration: none } a { color: #000000; font-family: 宋体; font-size: 9pt; text-decoration: none } a.mecl {COLOR: #000000; font-size:9pt; font-family:宋体; text-decoration:none} a:visited.mecl {COLOR: #000000;TOP: 1px; TEXT-DECORATION: none; font-family:宋体; font-size:9pt} a:hover.mecl {COLOR: #FF0000;position: relative; top: 1px; TEXT-DECORATION: none; font-family:宋体; font-size:9pt} --> </style> </head>

<body bgcolor="#6B96B4" leftmargin="0" topmargin="0" onLoad="MM_preloadImages('pic/5_go_3.gif','pic/5_go_4.gif','pic/5_go_5.gif','pic/5_go_6.gif','pic/5_go_7.gif')">

<div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="778"> <tr> <td width="100%"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" bgcolor="#FFFFFF"> <tr> <td width="100%"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="50%"><img name="" src="" width="200" height="60" alt=""></td> <td width="50%"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="468" height="60"> <param name="movie" value="swf/1.swf"> <param name="quality" value="high"> <embed src="swf/1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed> </object></td> <td width="50%" background="pic/x01_2.gif"><table width="109" height="60" border="0" cellpadding="0" cellspacing="0"> <tr> <td>&nbsp;</td> </tr> </table></td> </tr> </table> </center> </div> </td> </tr> <tr> <td width="100%"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="10%"><a href="company.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','pic/5_go_3.gif',1)"><img src="pic/x01_3.gif" alt="公司简介" name="Image16" width="114" height="38" border="0"></a></td> <td width="10%"><a href="product.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image17','','pic/5_go_4.gif',1)"><img src="pic/x01_4.gif" alt="产品信息" name="Image17" width="101" height="38" border="0"></a></td> <td width="10%"><a href="technic.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image18','','pic/5_go_5.gif',1)"><img src="pic/x01_5.gif" alt="技术支持" name="Image18" width="106" height="38" border="0"></a></td> <td width="10%"><a href="guestbook.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image19','','pic/5_go_6.gif',1)"><img src="pic/x01_6.gif" alt="客户留言" name="Image19" width="110" height="38" border="0"></a></td> <td width="10%"><a href="contact.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','pic/5_go_7.gif',1)"><img src="pic/x01_7.gif" alt="联系我们" name="Image20" width="107" height="38" border="0"></a></td> <td width="50%" background="pic/x01_9.gif"> </td> </tr> </table> </center> </div> </td> </tr> <tr> <td width="100%"><img border="0" src="pic/x01_12.gif" width="7" height="18"></td> </tr> <tr> <td width="100%"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" background="pic/bj_29.gif"> <tr> <td width="182" valign="top"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" background="pic/x00_25.gif" height="100%"> <tr> <td width="100%" height="86"><img border="0" src="pic/x01_15.gif" width="182" height="86"></td> </tr> <tr> <td width="100%" height="13"><img border="0" src="pic/x01_18.gif" width="7" height="13"></td> </tr> <% set rs=server.createobject("adodb.recordset") rs.open "select title from title_p",conn,1,3 if rs.Eof then Response.Write("<tr><td>栏目未初始化!</td></tr>") Else for i = 1 to rs.recordcount %> <tr> <td width="100%" height="33" background="pic/x01_20.gif"> <div align="right"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="75%"> <tr> <td width="100%" height="17" valign="bottom"> <b><a href="?post=<%=rs("title")%>"><%=rs("title")%>&nbsp;-&gt;</a></b></td> </tr> </table> </div> </td> </tr> <tr> <td width="100%" height="13"><img border="0" src="pic/x01_18.gif" width="7" height="13"></td> </tr> <% rs.movenext if rs.Eof then exit for next End if rs.close:set rs=nothing %> <tr> <td width="100%" height="13"><img border="0" src="pic/x01_18.gif" width="7" height="13"></td> </tr> <tr> <td width="100%" height="112"> <p align="center"><a href="contact.asp"><img border="0" src="pic/x01_25.gif" width="182" height="112"></a></td> </tr> <tr> <td width="100%" height="12"> </td> </tr> <tr> <td width="100%"> </td> </tr> </table> </center> </div> </td> <td width="596" valign="top"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="100%"><img border="0" src="pic/x01_16.gif" width="596" height="86"></td> </tr> <tr> <td width="100%"> <div align="right"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%"> <tr> <td width="100%" height="10"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="100%" height="30"> </td> </tr> <tr> <td width="100%"> <div align="left"> <table width="98%" border="0" style="border-collapse: collapse; word-break:break-all" bordercolor="#111111" cellpadding="0" cellspacing="0" height="110"> <!--DWLayoutTable--> <tr> <td width="23%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="30" bgcolor="#DAE6ED"> 产品名称</td> <td width="43%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="30"> <%=rstxt("name")%></td> <td width="34%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" rowspan="3" height="95"> <p align="center"> <a href="<%=rstxt("ims3")%>"> <img border="0" src="<%=rstxt("ims")%>" width="160" height="80"></a></td> </tr> <tr> <td width="23%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="30" bgcolor="#DAE6ED">技术参数</td> <td width="43%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="30"> <%=rstxt("money")%></td> </tr> <tr> <td width="23%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="30" bgcolor="#DAE6ED"> 详细说明</td> <td width="43%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" height="30"> <%=rstxt("txt")%></td> </tr> <tr> <td width="23%" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1" align="center" height="30" bgcolor="#DAE6ED"> 充电器套装</td> <td height="30" colspan="2" style="border: 1px solid #6B96B4; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1"> <%=rstxt("na")%></td> </tr> <tr> <td style="padding:0; " align="center" height="15" colspan="3"> </td> </tr> <% rstxt.movenext if rstxt.eof then End if %> <tr> <td style="padding:0; " align="center" height="30" colspan="3"> 共有记录<%=rstxt.recordcount%> 条&nbsp; <%=page%> /<%=rstxt.pagecount%> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="<%=request.servervariables("document_name")%>?post=<%=Request("post")%>&page=<%=page-1%>">上一页</a> <a href="<%=request.servervariables("document_name")%>?post=<%=Request("post")%>&page=<%=page+1%>">下一页</a>&nbsp;&nbsp;&nbsp; 转到第 <select onchange="window.location='?post=<%=Request("post")%>&page='+this.value" name="gopage"> <%for x=1 to rstxt.pagecount%> <option <%if x=page then%>selected<%end if%> value="<%=x%>"><%=x%></option> <%next%> </select> </td> </tr> </table> </center> </div> </td> </tr> </table> </div> </td> </tr> <tr> <td width="100%"> </td> </tr> </table> </center> </div> </td> </tr> </table> </div> </td> </tr> </table> </center> </div> </td> </tr> </table> </center> </div> </td> </tr> <tr> <td width="100%" height="9"> <p align="right"><img border="0" src="pic/x000_29.gif" width="778" height="26"></td> </tr> <tr> <td width="100%" height="8" bgcolor="#FFFFFF">  </td> </tr> <tr> <td width="100%"> <img src="pic/x01_29.gif" alt="返回顶部" width="778" height="40" border="0" usemap="#Map"></td> </tr> </table> </center> </div> </td> </tr> </table> </center> </div> <map name="Map"> <area shape="rect" coords="704,8,752,33" href="#top"> </map> </body>

</html> <%rstxt.close:set rstxt=nothing%>

2005-08-11 15:00
downdown
Rank: 1
等 级:新手上路
帖 子:139
专家分:0
注 册:2005-6-20
收藏
得分:0 
好长啊!!
2005-08-11 16:01
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
循环记录集用Do循环来做比较合适。

Do Until rs.EOF
     '循环代码
     rs.MoveNext
Loop
2005-08-11 21:31
快速回复:[求助]
数据加载中...
 
   



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

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