国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

用ASP和WML來實現數據庫查詢

2019-11-18 21:53:59
字體:
來源:轉載
供稿:網友
Shows how to perform a search with a WAP page and use asp on the server to do the database query and then
display the results.


<%Response.ContentType = "text/vnd.wap.wml"%>
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML
1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<%  
    Dim conn, rs  
    Dim strSQL,strFirstName, strLastName  
    Set conn = Server.CreateObject("ADODB.Connection")
    Set rs   = Server.CreateObject("ADODB.Recordset")

    conn.open session("myconnect_string") 'Replace with your connect string  

    strWhoIs = Request.QueryString("username")
    if strWhoIs="" then
%>
    <card id="UserSearch" title="Search">  
       <p>
          Please enter username to find? <input name="username" type="text" maxlength="15"/>
             <do type="accept" label="Locate">
                <go href="thispage.asp" method="get">
                   <postfield name="username" value="$username"/>
                </go>
             </do>     
       </p>
    </card>
<%
    else
strSQL = "SELECT * FROM tblUsers WHERE Username ='& strWhoIs & '"
Set rs = conn.Execute(strSQL)
      
%>  <card id="UserResult" title="Result">
         <p>            
<%
          if not rs.EOF then
           rs.MoveFirst
              Response.Write "<strong>User Search Results</strong>"
              While not rs.EOF
                 strFirstName = "First Name " & rs("FirstName")
                 strLastName = "Last Name " & rs("LastName")
                 Response.Write strFirstName
                 Response.Write strLastName
                 rs.MoveNext          
              Wend
          else
              Response.Write "Sorry, no user found."
          end if
%>
         </p>
       </card>
<%
    end if
%>
</wml>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 夏津县| 奈曼旗| 麻城市| 栾城县| 乌什县| 台安县| 台东市| 贡嘎县| 蒙自县| 大悟县| 阜南县| 南溪县| 电白县| 大厂| 永城市| 苍梧县| 东城区| 冀州市| 天台县| 高州市| 保靖县| 象州县| 崇州市| 封丘县| 平邑县| 墨江| 钦州市| 丽江市| 临安市| 辉南县| 景东| 靖宇县| 呼和浩特市| 五原县| 从江县| 临颍县| 湾仔区| 栾川县| 武威市| 保康县| 昭通市|