| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 438 人关注过本帖
标题:关于显示数据库记录的问题急急急
只看楼主 加入收藏
xiongwokao
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2005-9-24
结帖率:83.33%
收藏
 问题点数:0 回复次数:0 
关于显示数据库记录的问题急急急

Rs.open "pro_product1 '"&curpage&"','"&psize&"','"&bs&"/%'",conn,1,1 当把"&bs&"/%去掉里能显示所有记录加上条件就不能显示了 哪位大哥知道请帮小弟一下 本人在线等 <!--#include file="../data/conn.asp"--> <!--#include file="../data/adovbs.inc"-->

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <!--#include file="../data/meta.htm"--> <title>温州商业网 提供温州地区面对全国的商贸信息服务和外贸服务</title> <link href="../xxxxx.css" rel="stylesheet" type="text/css"> <link href="../css.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- a:link {color: #000000;} a:visited {color: #535353;} a:hover {color: #FF3300;} .style4 {font-size: 14; font-weight: bold;} --> </style> </head>

<body> <!--#include file="../bm-above.asp"--> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="5"></td> </tr> <tr> <td height="1" bgcolor="#2C9DDA"></td> </tr> <form action="cpsjk_list.asp" method="post" > <tr> <td height="28" bgcolor="#0A7CBF"><span class="wword"><strong>&nbsp;&nbsp;产品搜索</strong></span> <INPUT name="Search" id="search" size="50">&nbsp; <SELECT id="type" name="type" style="width:100"> <OPTION value="all">全部</OPTION> <OPTION selected value="p_name">产品名称</OPTION> <OPTION value="p_content">产品介绍</OPTION> </SELECT> &nbsp; <input name="Submit" type="submit" class="qybox" value=" 搜索 "> </td> </tr> </form> <tr> <td height="1" bgcolor="#0B659E"></td> </tr> <TR> <% Dim Rs_sort,id,Sql_sort Set Rs_sort = Server.CreateObject("Adodb.Recordset") Sql_sort = "Select * from product_type1 Where type1='"&request.QueryString("bs")&"'" Rs_sort.Open Sql_sort ,Conn,1,1 record1 = Rs_sort("type1_total") If Request.QuerySTring("bs1") <> "" Then Session("cp_bs1") = Request.Querystring("bs1") if Request("sort") <> "" Then Session("sort") = Request("sort") if Request("sort1")<> "" Then Session("sort1")= Request("sort1") %> <TD height="30">&nbsp;<span class="f14 style4"><%=Session("Sort")%> -- <%=Session("sort1")%></span>  <a href="cpsjk_2.asp?bs=<%=Session("cp_bs1")%>&Sort=<%=Session("Sort")%>" class="yy000000ff0000">返回</a></TD> </TR> <tr> <td height="10" bgcolor="#0A7CBF"></td> </tr> <TR> <td height="10"> <TABLE width="778" border=0 align="center" cellPadding=4 cellSpacing=1> <% Dim bs '分类代码 bs = Request.QueryString("bs") Dim Rs,Sql,CurPage,display,psize,record,pcount psize = 12 '每页数 curpage = clng(request("CurPage"))'传送页码值 ' Cmd.commandtype = AdCmdStoredProc ' Cmd.commandtext = "product1count" '统计产品总数存储过程 ' Cmd.parameters.append Cmd.createparameter("@record",adInteger,adParamoutput) ' Cmd.parameters.append Cmd.createparameter("@keyword",adVarChar,adParamInput,100) ' Cmd("@keyword") = "%/"&bs&"/" ' Cmd.execute() ' record = Cmd("@record") record = record1 pcount = int(record/psize) '计算总页数 if record mod psize > 0 then pcount = pcount + 1 end if if curpage = "" or curpage = 0 then curpage = 1 end if if curpage > pcount then '让传递的页码值不超出最大值 curpage = pcount end if Set Rs = Server.CreateObject("Adodb.Recordset") Rs.CursorLocation = 2 Rs.open "pro_product1 '"&curpage&"','"&psize&"','"&bs&"/%'",conn,1,1 response.Write(rs.recordcount) if not rs.eof then Rs.Move(psize*(curpage-1)) end if If Not Rs.eof Then Dim TotalPages TotalPages = pcount Dim Totalcount Totalcount = record StartPageNum=1 do while StartPageNum+10<=CurPage StartPageNum=StartPageNum+10 Loop EndPageNum=StartPageNum+9 If EndPageNum>pcount then EndPageNum=pcount I=0 l=1 p=psize*(Curpage-1) Do while Not RS.Eof And I < psize randomize numstart = hex(int((4095-256+1)*rnd+256)) numend = hex(int((4095-256+1)*rnd+256)) idhex = numstart & oct(strreverse(Rs("id"))) & numend & Len(Rs("id")) %> <TR onmouseout="this.bgColor=''" onmouseover="this.bgColor='#F4F4F4'" style="BORDER-TOP: #666666 1px dotted" > <td width="87" height="60" rowspan="2" align=center> <table width="60" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000"> <tr> <% If Rs("p_image") <> "" then imgurl = split(rs("p_image"), ";") %> <td width="60" height="60" align="center" bgcolor="#FFFFFF"><a href="prod_view.asp?id=<%=idhex%>" target="_blank"><img src="http://www.wzbm.com/user/pictr/product/<%=imgurl(0)%>" width="60" height="60" alt="<%=Rs("p_name")%>" border="0"></a></td> <% Else %> <td width="60" height="60" align="center" bgcolor="#FFFFFF"><font color=#999999>暂无图片</font></td> <% End if %> </tr> </table></td> <TD width="485" height="30"><span class="f14 style4"><a href="prod_view.asp?id=<%=idhex%>" target="_blank"> <%if l<6 and curpage = 1 then %><FONT color=#ff0000> <%end if l=l+1 %> <%=Rs("p_name")%></a></span> <%If Rs("p_image")<>"" Then%> <FONT color=#ff6600> [图片]</FONT> <%End If%> <FONT color=#ff6600> [已认证]</FONT></TD> <TD width="178" align=right><FONT color=#999999> 点击:<%=Rs("user_kit")%> <% If rs("p_date") <> "null" Then %> 发布日期:<%=DateValue(Rs("p_date"))%> <% end if%> </FONT></TD> </TR> <TR> <TD height="30" style="BORDER-BOTTOM: #666666 1px dotted"><FONT color=#666666>提供商: <%=Rs("p_company")%> 海关代码:<%=Rs("hs_code")%></FONT></TD> <TD align=right style="BORDER-BOTTOM: #666666 1px dotted"><a href="prod_view.asp?id=<%=idhex%>" target="_blank" class="yy000000ff0000">查看详细资料</a></TD> </TR> <% Rs.MoveNext I = I + 1 Loop Rs.Close : Set Rs = Nothing End If %> </TABLE></td> </tr> <tr> <td height="40" align="right" valign="bottom"><!--#include file="page.asp"--></td> </tr> <tr> <td height="10"></td> </tr> </table> <!--#include file="../bm-down.asp"--> </body> </html>

搜索更多相关主题的帖子: 数据库 记录 
2005-10-13 10:25
快速回复:关于显示数据库记录的问题急急急
数据加载中...
 
   



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

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