为什么网页浏览显示的结果是:没有结果可显示! 我的数据库里面的内容为什么显示不出来?
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="Connections/conn.asp"--><%Dim...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim rs1
Dim rs1_numRows
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_conn_STRING
rs1.Source = "SELECT Sid, SName, SNo, SSex FROM student"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
rs1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="792" border="0">
<%
Dim page1
Dim num1
Dim pagenum1
Dim lablenum
if (rs1.RecordCount>0) then
rs1.PageSize=5
num1=rs1.RecordCount
pagenum1=rs1.PageCount
page1=Request("page")
if (page1<> "") then
page1=CInt(page1)
if( Err.Number<> 0 )then
Err.Clear
page1=1
end if
if (page1<1)then
page1=1
end if
else
page1=1
end if
if (((page1*rs1.PageSize)>num) and (not((page1-1)*rs1.PageSize<num1)))then
page1=1
end if
rs1.AbsolutePage=page1
%>
<%if (page1<>pagenum1) then
lablenum=rs1.PageSize
else
lablenum=num1-((page1-1)*rs1.PageSize)
end if
for i=1 to lablenum
%>
<tr>
<td><%=(rs1.Fields.Item("SClass").Value)%></td>
<td><%=(rs1.Fields.Item("SName").Value)%></td>
<td><%=(rs1.Fields.Item("SNo").Value)%></td>
<td><%=(rs1.Fields.Item("SSex").Value)%></td>
</tr>
<%
rs1.MoveNext
Next
%>
</table>
<p> </p>
<table width="789" border="0">
<tr>
<td height="35">
<div align="right">
共有<%= num1 %>个链接|
<a href=show1.asp?page1=1>首页</a>|
<% if page1>1 then %><a href=show1.asp?page1=<%= page1-1%>> <% end if%>上一页</a>|
<% if page1<pagenum1 then %><a href=show1.asp?page1=<%= page1+1%>> <% end if%>下一页</a>|
<a href=show1.asp?page1=<%= pagenum1 %>>尾页</a>|
共<%= pagenum1 %>页</td>
</tr>
<% else %>
<tr>
<td>
<% Response.write("没有结果可显示!")%>
</td>
</tr>
</table>
</body>
</html>
<% End if
rs1.Close()
Set rs1 = Nothing
%> 展开
<!--#include file="Connections/conn.asp" -->
<%
Dim rs1
Dim rs1_numRows
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_conn_STRING
rs1.Source = "SELECT Sid, SName, SNo, SSex FROM student"
rs1.CursorType = 0
rs1.CursorLocation = 2
rs1.LockType = 1
rs1.Open()
rs1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table width="792" border="0">
<%
Dim page1
Dim num1
Dim pagenum1
Dim lablenum
if (rs1.RecordCount>0) then
rs1.PageSize=5
num1=rs1.RecordCount
pagenum1=rs1.PageCount
page1=Request("page")
if (page1<> "") then
page1=CInt(page1)
if( Err.Number<> 0 )then
Err.Clear
page1=1
end if
if (page1<1)then
page1=1
end if
else
page1=1
end if
if (((page1*rs1.PageSize)>num) and (not((page1-1)*rs1.PageSize<num1)))then
page1=1
end if
rs1.AbsolutePage=page1
%>
<%if (page1<>pagenum1) then
lablenum=rs1.PageSize
else
lablenum=num1-((page1-1)*rs1.PageSize)
end if
for i=1 to lablenum
%>
<tr>
<td><%=(rs1.Fields.Item("SClass").Value)%></td>
<td><%=(rs1.Fields.Item("SName").Value)%></td>
<td><%=(rs1.Fields.Item("SNo").Value)%></td>
<td><%=(rs1.Fields.Item("SSex").Value)%></td>
</tr>
<%
rs1.MoveNext
Next
%>
</table>
<p> </p>
<table width="789" border="0">
<tr>
<td height="35">
<div align="right">
共有<%= num1 %>个链接|
<a href=show1.asp?page1=1>首页</a>|
<% if page1>1 then %><a href=show1.asp?page1=<%= page1-1%>> <% end if%>上一页</a>|
<% if page1<pagenum1 then %><a href=show1.asp?page1=<%= page1+1%>> <% end if%>下一页</a>|
<a href=show1.asp?page1=<%= pagenum1 %>>尾页</a>|
共<%= pagenum1 %>页</td>
</tr>
<% else %>
<tr>
<td>
<% Response.write("没有结果可显示!")%>
</td>
</tr>
</table>
</body>
</html>
<% End if
rs1.Close()
Set rs1 = Nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询