<%text1=Request("text1") %>
<%text2=Request("text2") %>
<%text3=Request("text3") %>
<%
if text1<>""or text2<>"" or text3<>"" then
%>
<%
set conn=server.createobject("adodb.connection")
conn.open="driver={sql server};server=127.0.0.1;uid=sa;pwd=;database=tjphone"
sql="select * from tianjin where chanpin like " & "'%" &text1& "%'" & " and xingzhi like " & "'%" &text2& "%'" &"and lxdd like " & "'%" &text3& "%'"
set rs=Server.CreateObject("ADODB.recordset")
rs.open sql,conn,3
%>
<%
sub showonepage(rs,page)
rs.absolutepage=page
for kpage=1 to rs.pagesize
while not rs.eof
row="<tr align=middle>"
for i=0 to rs.fields.count-1
row=row&"<td>"&rs(i)&"</td>"
next
Response.Write row&"</tr>"
rs.movenext
if rs.eof then exit for
wend
%>
<%
next
end sub
%>
<% rs.pagesize=5
page=1
page=clng(request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
showonepage rs,page
%>
<% if page<>1 then%>
<a href="xun.asp?page=1">第一页</a><a href="xun.asp?page=<%=(page-1)%>">上一页</a>
<% end if%>
<% if page<>rs.pagecount then%>
<a href="xun.asp?page=<%=(page+1)%>">下一页</a><a href="xun.asp?page=<%=rs.pagecount%>">最后一页</a>
<% end if%>
<%
end if
%>
查询后的数据为什么不是5页一翻的,谢谢高手门.