<%Server.ScriptTimeout = 1000
on error resume next
connstr="DBQ="+server.mappath("savedata.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
set rs=server.CreateObject("adodb.recordset")
set rscity=server.CreateObject("adodb.recordset")
sql="select * from cust "
rs.open sql,conn,1,1
if rs.eof then
response.write "aa"
else
response.write "bb"
end if
%>
<%
currentPage="chengshi.asp"
const MaxPerPage=3000
dim rs,totalPut,CurrentPage,TotalPages,j,page_name,n,k,i
i=0
page_name="chengshi.asp?pro_id="&request.QueryString("pro_id")
set rs=server.createobject("adodb.recordset")
sql="select * from cust"
rs.open sql,conn,1,3
if rs.eof then
response.write "暂无数据!"
else
rs.MoveFirst
rs.pagesize=MaxPerPage
If trim(Request("Page"))<>"" then
CurrentPage= CLng(request("Page"))
If CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If
totalPut=rs.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage<totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
end if
end if
end if
if (totalPut mod MaxPerPage)=0 then
n=totalPut\MaxPerPage
else
n=totalPut\MaxPerPage+1
end if
do while not rs.eof and i<maxperpage
%>
<div align="center">
<table width="44%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td height="24" align="center">号码</td>
<td height="24" align="center">城市</td>
</tr>
<%do while not rs.eof
%>
<tr>
<td align="center"><%=rs("Mobile")%></td>
<td width="181" align="center"><%
sqlcity="select * from city where phone='"&left(rs("Mobile"),7)&"'"
rscity.open sqlcity,conn,1,1
if rscity.eof then
response.write "-"
else
response.write rscity("city")
end if
rscity.close
%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
</div>
<!--下面是分页超链接部分-->
<%
i=i+1
rs.movenext
loop
%><%
k=currentPage
if k<>1 then
response.write "[<b>"+"<a href='"&page_name&"&page=1'>首页</a></b>] "
response.write "[<b>"+"<a href='"&page_name&"&page="+cstr(k-1)+"'>上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b>"+"<a href='"&page_name&"&page="+cstr(k+1)+"'>下一页</a></b>] "
response.write "[<b>"+"<a href='"&page_name&"&page="+cstr(n)+"'>尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
rs.close()
%>
这段代码那位大哥可以帮我看看为什么执行效率慢啊!帮我修改一下啊!