請各位大俠幫忙指教下面分頁程式,因為運行時只顯示第一頁內容,並且沒有超連接的功能,急!!謝謝先
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<%
Set Conne = Server.CreateObject("ADODB.Connection")
conne.open "Driver={MySQL ODBC 3.51 Driver};" & "server=te-lab; uid=TEUser; pwd=teuser; database=tedb_01; autotranslate=false"
Set RS=Server.CreateObject("ADODB.RecordSet")
sql="select * from dqs"
rs.open sql,conne,1,3,1
%>
<%
dim maxpages
dim totalrecord
dim TotalPages
if not isempty(Request.QueryString("page")) then
thepage=cint(Request.QueryString("page"))
else
thepage=1
end if %>
<%
if not rs.eof then '在最後結束
rs.pagesize=6
totalrecord=rs.recordcount
totalpages=rs.pagecount
maxpages=rs.pagesize
if thepage>totalpages or thepage<=0 then
thepage=1
showContent
else
rs.absolutepage=thepage
showContent
end if
rs.close
set rs=nothing
conne.close
set conne=nothing
%>
<%sub showContent%>
<center>
<input type="hidden" name="thepage" value="<% =thepage %>">
<% dim i
i=1
do while not rs.eof
%>
<table>
<TBODY>
<tr bgcolor=#f1fce4>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 90px"
> <P align=center><FONT size=2><%=RS("TENo") %></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 90px"
> <P align=center><FONT size=2><%=rs("ProductType")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 90px"
> <P align=center><FONT size=2><%=rs("ItemName")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 90px"
> <P align=center><FONT size=2><%=rs("ChnName")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 70px"
> <P align=center><FONT size=2><%=rs("PropertyNo")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 45px"
> <P align=center><FONT size=2><%=rs("Quantity")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 45px"
> <P align=center><FONT size=2><%=rs("LeftQuantity")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 85px"
> <P align=center><FONT size=2><%=rs("DestroyedDate")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 150px"
> <P align=center><FONT size=2><%=rs("Reason")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 150px"
> <P align=center><FONT size=2><%=rs("Action")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 85px"
> <P align=center><FONT size=2><%=rs("RepairedDate")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 70px"
> <P align=center><FONT size=2><%=rs("Owner")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 85px"
> <P align=center><FONT size=2><%=rs("TargetDate")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 85px"
> <P align=center><FONT size=2><%=rs("ActualDate")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 60px"
> <P align=center><FONT size=2><%=rs("Status")%></FONT></P></TD>
<TD borderColor=#9400d3 style="HEIGHT: 40px; WIDTH: 150px"
> <P align=center><FONT size=2><%=rs("Remark")%></FONT></P></TD>
<% i=i+1
if i>=maxpages then%>
<% exit do%>
<%end if%>
<% rs.movenext%></tr>
<% loop%></center></TBODY></table>
<table>
<% If thepage>=1 Then %>
<% showpages '顯示分頁情況 %>
<%end if%>
<% end sub%>
<%
else
response.write "<font size='4' color='#000000'>現在沒有有內容。</font>"
rs.close
set rs=nothing
conne.close
set conne=nothing
end if
%>
<%
Sub showpages
if thepage=1 then
Response.Write "【首頁】"
Response.Write "【上一頁】"
else %>
<% Response.Write "<A href=line.asp>【首頁】</A>"
Response.Write "<A href=line.asp?Page=" & (thepage-1) &">【上一頁】</A>"%>
<% end if
if totalpages-thepage<1 then
Response.Write "【下一頁】"
Response.Write "【尾頁】"
else %>
<% Response.Write "<A href=line.asp?Page=" & (thepage+1) &">【下一頁】</A>"
Response.Write "<A href=line.asp?Page=" & totalPages &">【尾頁】</A>" %>
<%end if%>
<% Response.Write "【第<font color=#000000>" & thepage & "</font>頁】"
Response.Write "【共<font color=#000000>" & totalpages & "</font>頁】"
Response.Write "【共<font color=#ff0000>" & totalrecord & "</font>條記錄】"
End Sub
%>
</CENTER>
<center>
</center></table></body> </html>