% 'on error resume next key=Request("key") RentalRoad= Request("RentalRoad") RentalXiang = Request("RentalXiang") RentalLong = Request("RentalLong") RentalRoad1= Request("RentalRoad1") RentalXiang1 = Request("RentalXiang1") RentalLong1 = Request("RentalLong1") PAGE = Request("PAGE") IF PAGE = "" THEN PAGE = 1 ELSE PAGE = PAGE END IF Set conn=OpenConn(9) Set rs = Server.CreateObject("ADODB.Recordset") if (RentalRoad ="") and (RentalRoad1="") and (RentalXiang="" ) and (RentalXiang1="" ) and (key= "") and (RentalLong= "")and (RentalLong1= "")then SortSql = "Select * From carfax where (road_no='000')" else SortSql= "Select * From carfax where (road_no <>'000')" end if if key <> "" then SortSql= SortSql+" and( key like '%" & key & "%') or ( road_name like '%" & key & "%')" end if if RentalRoad <> "全部" and RentalRoad <> "" then SortSql =SortSql+" and ((road_name like '%" & RentalRoad & "%') or ( key like '%" & RentalRoad & "%'))" end if if RentalXiang <> "" then RentalXiang_no=RentalXiang+"巷" SortSql = SortSql+" and ((road_name like '%" & RentalXiang_no & "%') or ( key like '%" & RentalXiang_no & "%'))" end if if RentalLong <> "" then RentalLong_no=RentalLong+"弄" SortSql = SortSql+" and ((road_name like '%" & RentalLong_no & "%') or ( key like '%" & RentalLong_no & "%'))" end if if RentalRoad1 <> "全部" and RentalRoad1<> "" then SortSql =SortSql+" and ((road_name like '%" & RentalRoad1 & "%') or ( key like '%" & RentalRoad1 & "%'))" end if if RentalXiang1 <> "" then RentalXiang1_no=RentalXiang1+"巷" SortSql = SortSql+" and ((road_name like '%" & RentalXiang1_no & "%') or ( key like '%" & RentalXiang1_no & "%'))" end if if RentalLong1 <> "" then RentalLong1_no=RentalLong1+"弄" SortSql = SortSql+" and ((road_name like '%" & RentalLong1_no & "%') or ( key like '%" & RentalLong1_no & "%'))" end if rs.Open SortSql, conn, 1,3 RS.PageSize = 10 ' 設定每頁顯示 10 筆 If Not rs.eof Then ' 有資料才執行 RS.AbsolutePage = PAGE ' 將資料錄移至 PAGE 頁 End if %>
|
|||||||||||||||||||||||||||