如何封装这些数据

RFASK射频问问
RFASK射频问问官方账号
2004-02-09 08:27:45
<!--#include file="head.asp"-->
<%
const Max=4
if not isEmpty(request("sortid")) then
sortid=request("sortid")
else
sortid=""
end if
if not isEmpty(request("typeid")) then
typeid=request("typeid")
else
typeid=""
end if

%>
<% set rs=server.createobject("adodb.recordset")
if not isempty(request("page")) then
pagecount=cint(request("page"))
else
pagecount=1
end if
sql="select * from qyml where cflag=1 and sortid="&sortid&" and typeid="&typeid&""
rs.open sql,conn,1,1
if rs.eof then
response.write"<p align='center'><font size=2>对不起,没有您要查询的信息!</font></p>"
end if
rs.pagesize=6
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.AbsolutePage=pagecount %>




这以后除了<!--#include file="../END.asp"-->要执行外其它的都不要执行了~

<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8"></td>
</tr>
<tr>
<td height="1" colspan="2" bgcolor="#666666"></td>
</tr>
</table>
<% do while not rs.eof %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="fdfceb" height="30">
<td width="30" align="left"> </td>
<td width="520" align="left"><a href=index.asp?id=<%=rs("id")%>><b><%=rs("qymc")%></b></a>  <font color="#fc9603">【<%=rs("qylb")%>】  </font>【<%=rs("sf")%>】</td>
</tr>
<tr bgcolor="fdfceb" height="30">
<td align="left"> </td>
<td align="left">主要产品:<%=rs("zycp")%></td>
</tr>
<tr bgcolor="fefefe" height="30">
<td bgcolor="fdfceb"> </td>
<td bgColor=fdfceb><%=mid(rs("qyjj"),1,60)%>.....</td>
</tr>
<tr align="right" bgcolor="fdfceb" height="5">
<td height="25" colspan="2"><img src="image/bg0-13.gif"> <a href=index.asp?id=<%=rs("id")%>><strong>查看详细信息</strong></a>    </td>
</tr>
<tr>
<td height="1" colspan="2" bgcolor="#666666"></td>
</tr>
</table>
<% i=i+2
rs.movenext
if i>=rs.PageSize then exit do
loop
%>
</td>
<td width="200" align="right" valign="top">
<table width="183" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/gshy25.gif" width="183" height="27"></td>
</tr>
<tr>
<td height="182" align="center" valign="top" background="image/gshy23.gif"><table cellspacing="0" cellpadding="2" border="0" width="181">
<%set rsg=server.createobject("adodb.recordset")
gsql="select top 10 * from qyml where cflag=1 and sortid="&sortid&" and typeid="&typeid&" order by id desc"
rsg.open gsql,conn,1,1
do while not rsg.eof%>
<tr valign="top">
<td height="20" align=left> <font color=#666000> •</font> <a href=index.asp?id=<%=rsg("id")%> target="_blank"><%=left(rsg("qymc"),13)%></a></td>
</tr>
<tr>
<td height="1" bgcolor="eeeeee"></td>
</tr>
<% rsg.movenext
loop
rsg.close
set rsg=nothing
%>
<tr>
<td height="20" align="right"><a href="STAR.ASP">更多诚信会员</a></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
</table></td>
</tr>
</table>

这个要显示
<!--#include file="../END.asp"-->

rs 查询qymc 表时如果表中没记录

即 if rs.eof then
response.write"<p align='center'><font size=2>对不起,没有您要查询的信息!</font></p>"

下面的表什么的都不会显示包括
set rsg=server.createobject("adodb.recordset")
gsql="select top 10 * from qyml where cflag=1 and sortid="&sortid&" and typeid="&typeid&" order by id desc"
rsg.open gsql,conn,1,1
do while not rsg.eof%>
也不执行出来

但最下面的
<!--#include file="../END.asp"-->

会执行出来。
...全文
37 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧