编程高手请进,问个比较郁闷的问题!
来源:百度知道 编辑:UC知道 时间:2024/09/24 13:21:30
请教一个问题!呵呵,麻烦大家了!
代码:
<%
set rs=Server.CreateObject("ADODB.RecordSet")
< !--以下是第177行>
Rs.open "Select * from Products where type="&zlm(id,1)&" ORDER BY "&session("pxzd")&" DESC ",conn,1
< !--以上是第177行>
zys=rs.recordcount\15
if rs.recordcount mod 15<>0 then
zys=zys+1
end if
if Rs.Eof then %>
<tr><td height="34" bgcolor="#F6F6F6">
<p align="center">此 种 类 现 在 没 有 商 品!</p>
</td></tr>
<%else%>
<tr>
<%
rs.PageSize=15
if session("currentpage")>zys then
session("currentpage")=zys
end if
if session(&qu
代码:
<%
set rs=Server.CreateObject("ADODB.RecordSet")
< !--以下是第177行>
Rs.open "Select * from Products where type="&zlm(id,1)&" ORDER BY "&session("pxzd")&" DESC ",conn,1
< !--以上是第177行>
zys=rs.recordcount\15
if rs.recordcount mod 15<>0 then
zys=zys+1
end if
if Rs.Eof then %>
<tr><td height="34" bgcolor="#F6F6F6">
<p align="center">此 种 类 现 在 没 有 商 品!</p>
</td></tr>
<%else%>
<tr>
<%
rs.PageSize=15
if session("currentpage")>zys then
session("currentpage")=zys
end if
if session(&qu
首先:177 错误在这里
Rs.open "Select * from Products where type="&zlm(id,1)&" ORDER BY "&session("pxzd")&" DESC ",conn,1 ,3
着CONN数据库没打开
还有这里,如果没有记录呢?zys=什么?你没有给出来.那就
zys=rs.recordcount\15
if rs.recordcount mod 15<>0 then
zys=zys+1
end if 改成else
if Rs.Eof then %>
<tr><td height="34" bgcolor="#F6F6F6">
<p align="center">此 种 类 现 在 没 有 商 品!</p>
</td></tr>
<%end if%>
...............
Rs.open "Select * from Products where type="&zlm(id,1)&" ORDER BY "&session("pxzd")&" DESC ",conn,1,1
conn没有开哦。。。。你这个小马虎
就是conn 没有被打开 的了。呵呵
conn 没有被打开 ...
还是conn 没有被打开 ...