<%
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
%>
<%text1=Request("text1") %>
<%text2=Request("text2") %>
<%text3=Request("text3") %>
<% sub showonepage(rs,page) %>
<% rs.absolutepage=page %>
<% for kpage=1 to rs.pagesize %>
<%
if text1<>""or text2<>"" or text3<>"" then
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
end if
%>
<% next %>
<% end sub %>
<% rs.pagesize=10
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="chaxun.asp?page=1">第一页</a><a href="chaxun.asp?page=<%=(page-1)%>">上一页</a>
<% end if%>
<% if page<>rs.pagecount then%>
<a href="chaxun.asp?page=<%=(page+1)%>">下一页</a><a href="chaxun.asp?page=<%=rs.pagecount%>">最后一页</a>
<% end if%>
这是一个分页加查询的代码,为什么在查询是所以的内容都出现了呢,而不是查询的内容,谢谢.