asp + wap 实现查询系统
2006-03-22 20:29
459 查看
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>
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>
相关文章推荐
- c基础+数据结构+线程+冒泡实现--航班查询系统
- 查询词提示系统的简单实现
- 病人资料管理系统中高级查询功能的实现
- 模块管理常规功能自定义系统的设计与实现(41--终级阶段 综合查询[8]分类汇总)
- 模块管理常规功能自定义系统的设计与实现(35--终级阶段 综合查询[2])
- 数据库系统实现译文(查询过程概述)
- 【数学建模集训系列】公交查询系统的matlab实现-站点和站点之间直达矩阵
- 模块管理常规功能自定义系统的设计与实现(38--终级阶段 综合查询[5])
- 【数学建模集训系列】公交查询系统的matlab实现-运行截图和结果
- 【数学建模集训系列】公交查询系统的matlab实现-价格计算
- Spring(16):新增功能:在超市订单系统中实现订单表的查询(采用MapperFactoryBean)
- ATM系统实现[8]——转帐查询窗口[00原创]
- hibernate分组查询后,求分组总数的实现方法(管理系统分页)
- Android实现正方系统的登录以及课程表,成绩获取和空课室的查询(二)
- python实现域名系统(DNS)正向查询的方法
- vb.net机房收费系统—组合查询的实现
- 公交查询系统的设计与实现
- 用链表写的学生管理系统 成绩的录入与查询都已经是实现了
- 驾照考试题库查询系统(wap版兼普通web版实现,使用php+wml)
- DRP系统分页查询实现