14.2.3  д
1. ѯҳ
ڷĿ¼½ļDefault.wml
<?xml version="1.0" encoding="gb2312"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum
.org/DTD/wml_1.1.xml"> 

<wml> 
<card id="rent" title="кѯϵͳ"> 
<p>кѯϵͳ</p>
<p>ѡѯ 
<fieldset title="area">
Ŀĵ
<select name="destination_c" value="01" title="Ŀĵ"> 
      <option value="01"></option> 
      <option value=""></option> 
      <option value=""></option> 
      <option value=""></option> 
      <option value="ͺ ">ͺ</option> 
</select> 
<br></br> 
չ˾ 
<select name="company_c" value="01" title="չ˾"> 
      <option value="01"></option> 
      <option value="ca">ca</option> 
      <option value="hu">hu</option> 
      <option value="cj">cj</option> 
      <option value="xw">xw</option> 
  </select>
<br></br>

<select name="type_c" value="01" title=""> 
      <option value="01"></option> 
      <option value="733">733</option> 
      <option value="734">734</option> 
      <option value="772">772</option> 
      <option value="m82">m82</option>
</select> 
</fieldset> 
<anchor title="ѯ">ѯ
<go href="que.asp"> 
      <postfield name="destination" value="$(destination_c)"/> 
      <postfield name="company" value="$(company_c)"/> 
      <postfield name="type" value="$(type_c)"/> 
</go>
</anchor>
</p>
</card>
</wml>
ļʵ˲ѯ棬ѯťת"que.asp"ļû¼ѯ͸"que.asp"ļ
2. ASPݿ
ڷĿ¼½ļque.asp
<%
  Response.ContentType="text/vnd.wap.wml" 
  Response.Write"<?xml version=""1.0"" encoding=""gb2312""?>"&vbcrlf 
  Response.Write"<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml"">"&vbcrlf 
  Response.Write"<wml>"&vbcrlf 
  Response.Write"<template>"
  Response.Write"<do type=""prev"" name=""prev"" lable=""previous"">" 
  Response.Write"<prev/>" 
  Response.Write"</do>" 
  Response.Write"</template>" 
  Response.Write"<card id=""sail"" title=""Ϣ "">"&vbcrlf 
  Response.Write"<p>"&vbcrlf 
%> 

<% Language=VBScript %> 
<% 
  dim conn,sqlStr,rs,strDestination,strCompany,strType 
  set conn=Server.CreateObject("ADODB.Connection") 
  conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server
.MapPath("db.mdb")

  strDestination=Request.querystring("destination")
  if (strDestination="01") then 
      strDestination=""
  Endif 
  strCompany=Request.querystring("company") 
   if (strCompany="01") then 
strCompany="" 
Endif 

  strType=Request.querystring("type") 
  if (strType="01") then 
      strType="" 
Endif 

sqlStr="select * from info where destination like'%"&strDestination&"%' and company like'%"&strCompany&"%' and type like'%"&strType&"%'" 
  set rs=conn.Execute(sqlStr) 
  while not rs.eof 
    i=i+1 
    Response.Write""&i&"¼<br></br>" 
    Response.Write"   :"&rs("id")&_ 
                     "ʱ :"&rs("leaveTime")&_ 
                     "Ŀĵ:"&rs("destination")
    Response.Write"<br></br>" 
    Response.Write" ʱ :"&rs("landingTime")&_ 
                     ":"&rs("type")&_
                     "Ʊ:"&rs("price")&_
                     "˾:"&rs("company") 
    Response.Write"<br></br>" 
    rs.movenext 
  wend 
   if (i=0) then 
      Response.Write"Բûзļ¼"
  Endif 

  Response.Write"</p>"&vbcrlf 
  Response.Write"</card>"&vbcrlf 
  Response.Write"</wml>" 
  set rs=nothing 
  conn.close 
%> 
ļʵ˷ݿ⣬ִSQLѯѯWAPҳĹ淶ͻ˵Ļϡ
