<% if request("mingsheng")<>"" then mySQL="Select * from history where history_name like '%"&sql(request("mingsheng"))&"%' order by id" else response.Write("请输入您要去的地点!") response.End() end if set rs = server.createobject("adodb.recordset") rs.Open mySQL,conn,3,1 if rs.eof then response.Write("
对不起,没有找到您要去的地点,请简化您的地点字数,
例如您输入的是天津市食品街,请改成食品街再重新搜索一次!") response.Write("

返回重新搜索") response.End() end if do while not rs.eof %>
您要去的地点:  <%=rs("history_name")%>
次地点的详细地址:  <%=rs("history_address")%>
次地点的附近的站点:  <%=rs("history_bus_station")%>
路过此地点的公车路线:  <%=rs("history_bus_num")%>
具体更详细的路线看下面的搜索结果

返回重新搜索

 以下为详细搜索结果

<% station=rs("history_bus_station") station=replace(station,",",",") if right(station,1)="," then station=left(station,len(station)-1) stations=split(station,",") num=ubound(stations) 'response.write(num) for i=0 to num set rs2=server.createobject("adodb.recordset") mySQL="Select * from bus where address like'%"&stations(i)&"%' order by busid" rs2.open mySQL,conn,3,1 response.write("  经过"&stations(i)&"站的公车路线")%>

<% while not rs2.eof %> <% rs2.movenext wend rs2.close set rs2=nothing %>
路线 详细站点
  <%Response.Write rs2("busid")&"路"%> <%Response.Write replace(replace(replace(replace(rs2("address"),"、","—"),stations(i),""&stations(i)&""),stations(i),""&stations(i)&""),stations(i),""&stations(i)&"")%>

<% next rs.movenext loop%>