因上原有贴子上字体调不了,所以重新发一份.
我的一个上网报修系统,在Windows XP SP2系统界面下,进入管理页面中时可以从数据库出来的数据,显示表格的具体内容。
而我把这个程序放要Windows2003 Server SP1系统界面下,进入管理页面时看不到数据,只显示暂时没有信息!。这是哪里出了错?
这个页面的代码是这样的:
<!--#include file =conn2.asp-->
<%if session("pass")<>"ok" then
Response.Redirect "index.asp"
Response.End
end if
%>
<%
const MaxPerPage=30
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
dim rstype
dim typesql
dim typeid,typename1
if not isEmpty(request("typeid")) then
typeid=request("typeid")
else
typeid=1
end if
%>
<%
user_lib="admin"
Set radmin = Server.CreateObject("ADODB.Recordset")
sql="select * from guestbook order by pubtime desc"'"
radmin.open sql,conn,3,2
%>
<html>
<head>
<title>后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" >
<!--#include file =houtai.asp-->
<table border="0" width="98%" cellspacing="0" cellpadding="0" height="72" align="center">
<tr>
<td width="14%" height="44" align=center>
<td width="63%" height="44" align=center>
<div align="center"> </div>
<td width="23%" height="44" align=center>
<tr>
<td align=center colspan="3">
<%
sql="select * from guestbook order by pubtime desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有信息!</p>"
else
totalPut=rs.recordcount
TotalPage = RS.PageCount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"lyedit.asp"
showContent
showpage totalput,MaxPerPage,"lyedit.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"lyedit.asp"
showContent
showpage totalput,MaxPerPage,"lyedit.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"lyedit.asp"
showContent
showpage totalput,MaxPerPage,"lyedit.asp"
end if
end if
rs.close
end if
set rs=nothing
sub showContent
dim i
i=0
%>
<table cellspacing="0" bordercolorlight="#FFFFFF" width="100%">
<tr align="center">
<td valign="top" colspan="3">
<table width="100%" cellpadding="0" cellspacing="1" border="0" bordercolordark="#FFFFFF" bordercolorlight="#808080" bgcolor="#66CCCC" >
<tr bgcolor="#66FFCC" >
<td width="79" height="25" > <div align="center">编号</div></td>
<td width="360" height="25" > <div align="center">维修反馈</div></td>
<td width="158" height="25" ><div align="center">维修人员</div></td>
<td width="212" height="25" ><div align="center">维修时间</div></td>
<td width="96" height="25" ><div align="center">修复与否</div></td>
<td width="73" height="25" ><div align="center">删除</div></td>
</tr>
<%do while not rs.eof
id=rs("id")
pubname=rs("pubname")
pubtime=rs("pubtime")
pubmain=rs("pubmain")
publink=rs("publink")
cap=server.urlencode(id)
%>
<tr bgcolor="#FFFFFF" >
<td width="79" height="25" >
<div align="center"><font color="#FF0000"><%=id%></font></div></td>
<td width="360" height="25" > <div align="center"><font color="#0000FF"><%=rs("pubmain")%></font></div></td>
<td width="158" height="25" ><div align="center"><font color="#0000FF"><%=rs("pubname")%></font></div></td>
<td width="212" height="25" ><div align="center"><font color="#0000FF"><%=rs("pubtime")%></font> </div></td>
<td width="96" height="25" ><div align="center"><font color="#0000FF"><%=rs("publink")%></font></div></td>
<td width="73" height="25" ><div align="center"><font color="#333333" ><a href="dele_ly.asp?id=<%=id%>">删除</a></font></div></td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action='lyedit.asp?user="&username&"'>"
response.write "<p align='center' vAlign='bottom'>"
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&typename="&typename&"&keyword="&keyword&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&typename="&typename&"&keyword="&keyword&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&CurrentPage+1&"&typename="&typename&"&keyword="&keyword&">下一页</a> "
response.write "<a href="&filename&"?page="&n&"&typename="&typename&"&keyword="&keyword&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " 共<b>"&totalnumber&"</b>条信息 <b>"&maxperpage&"</b>条信息/页 "
response.write " 转到:"
%>
<select name="Page" <% if totalpage = 0 then Response.Write("disabled")%> size=1 class=smallselsect style="BACKGROUND-COLOR:#BBE3FF;font-family: verdana; font-size:7pt;">
<% for I = 1 to n %>
<option value="<%=I%>" <% if I = CInt(CurrentPage) then Response.write("selected") end if %>><%=I%></option>
<% Next %>
</select>
<%
response.write " <input class=buttonface type='submit' value='ENTER' name='cndok' style='border: 1px #333333 solid; background-color: #BBE3FF; font-family:verdana; font-size: 7pt;'></span></p></form>"
end function
%>
</td>
</tr>
</table>
</table>
<%
radmin.close
set radmin=nothing%>
[此贴子已经被作者于2006-9-21 16:11:01编辑过]