扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:builder.com.cn 2007年1月18日
关键字:
<%@ Language=VBScript %>
<%
Response.ContentType = "text/vnd.wap.wml"
Response.Expires = -1
Dim qt, qv, n
Dim rs, conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("../test.mdb") & ";User Id=;Password=;"
Set rs = Server.CreateObject("ADODB.Recordset")
Set rs.ActiveConnection = conn
qt = Request("qt")
qv = Request("qv")
%>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="main" title="Select">
<do type="prev">
<go href="wap1.asp"/>
</do>
<p>
<%
If qt = "loc" Then
If qv = "" Then
rs.Open "SELECT * FROM tblLocation"
Response.Write "<select name=""qv"">" &
vbCrLf
Do While Not rs.EOF
Response.Write vbTab & "<option value=""" &
rs.Fields("location_id") & """>" &
_
rs.Fields("location") & "</option>" &
vbCrLf
rs.MoveNext
Loop
Response.Write "</select><br/>" & vbCrLf
Response.Write "<anchor>Submit" & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""dpt""/>"
& vbCrLf & _
"<postfield name=""qv"" value=""$qv""/>"
& vbCrLf & _
"</go>" & vbCrLf & _
"</anchor>"
Else
sql = "SELECT tblPhone.* " & _
"FROM tblPhone " & _
"INNER JOIN tblLocation " & _
"ON tblLocation.location_id = tblPhone.location_id " & _
"WHERE tblLocation.location_id = " & qv
If Request("pid") > 0 Then sql = sql & " AND phone_id
> " &
Request("pid")
sql = sql & " ORDER BY tblPhone.last_name"
rs.Open sql
n = 0
Do While n < 5 And Not rs.EOF
n = n + 1
Response.Write "<anchor>" & rs.Fields("last_name")
& ", " & _
rs.Fields("first_name") & vbCrLf & _
"<go href=""data.asp"" method=""post"">"
&
vbCrLf & _
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor><br/>"
rs.MoveNext
Loop
If Not rs.EOF Then
Response.Write "<anchor>More..." & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""loc""/>"
& vbCrLf & _
"<postfield name=""qv"" value="""
& qt & """/>" &
vbCrLf & _
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor>"
End If
End If
ElseIf qt = "dpt" Then
If qv = "" Then
rs.Open "SELECT * FROM tblDepartment"
Response.Write "<select name=""qv"">" &
vbCrLf
Do While Not rs.EOF
Response.Write vbTab & "<option value=""" & rs.Fields("deptid")
&
""">" & _
rs.Fields("dept") & "</option>" & vbCrLf
rs.MoveNext
Loop
Response.Write "</select><br/>" & vbCrLf
Response.Write "<anchor>Submit" & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""dpt""/>"
& vbCrLf & _
"<postfield name=""qv"" value=""$qv""/>"
& vbCrLf & _
"</go>" & vbCrLf & _
"</anchor>"
Else
sql = "SELECT tblPhone.* " & _
"FROM tblPhone " & _
"INNER JOIN tblDepartment " & _
"ON tblDepartment.deptid = tblPhone.location_id " & _
"WHERE tblDepartment.deptid = " & qv
If Request("pid") > 0 Then sql = sql & " AND phone_id
> " &
Request("pid")
sql = sql & " ORDER BY tblPhone.last_name"
rs.Open sql
n = 0
Do While n < 5 And Not rs.EOF
n = n + 1
Response.Write "<anchor>" & rs.Fields("last_name")
& ", " & _
rs.Fields("first_name") & vbCrLf & _
"<go href=""data.asp"" method=""post"">"
&
vbCrLf & _
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor><br/>"
rs.MoveNext
Loop
If Not rs.EOF Then
Response.Write "<anchor>More..." & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""dpt""/>"
& vbCrLf & _
"<postfield name=""qv"" value="""
& qt & """/>" &
vbCrLf & _
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor>"
End If
End If
ElseIf qt = "fn" Then
sql = "SELECT tblPhone.* " & _
"FROM tblPhone " & _
"INNER JOIN tblDepartment " & _
"ON tblDepartment.deptid = tblPhone.location_id " & _
"WHERE tblPhone.first_name LIKE '" & qv & "%'"
If Request("pid") > 0 Then sql = sql & " AND phone_id
> " & Request("pid")
sql = sql & " ORDER BY tblPhone.phone_id"
rs.Open
n = 0
Do While n < 5 And Not rs.EOF
n = n + 1
Response.Write "<anchor>" & rs.Fields("last_name")
& ", " & _
rs.Fields("first_name") & vbCrLf & _
"<go href=""data.asp"" method=""post"">"
& vbCrLf &
_
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor><br/>"
rs.MoveNext
Loop
If Not rs.EOF Then
Response.Write "<anchor>More..." & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""fn""/>"
& vbCrLf & _
"<postfield name=""qv"" value="""
& qv & """/>" & vbCrLf &
_
"<postfield name=""pid"" value="""
& rs.Fields("phone_id")
& """/>" & vbCrLf & _
"</go>" & vbCrLf & _
"</anchor>"
End If
ElseIf qt = "ln" Then
sql = "SELECT tblPhone.* " & _
"FROM tblPhone " & _
"INNER JOIN tblDepartment " & _
"ON tblDepartment.deptid = tblPhone.location_id " & _
"WHERE tblPhone.last_name LIKE '" & qv & "%'"
If Request("pid") > 0 Then sql = sql & " AND phone_id
>= " & Request("pid")
sql = sql & " ORDER BY tblPhone.phone_id"
rs.Open sql
n = 0
Do While n < 5 And Not rs.EOF
n = n + 1
Response.Write "<anchor>" & rs.Fields("last_name")
& ", " & _
rs.Fields("first_name") & vbCrLf & _
"<go href=""data.asp"" method=""post"">"
& vbCrLf &
_
"<postfield name=""pid"" value="""
&
rs.Fields("phone_id") & """/>" & vbCrLf
& _
"</go>" & vbCrLf & _
"</anchor><br/>"
rs.MoveNext
Loop
If Not rs.EOF Then
Response.Write "<anchor>More..." & vbCrLf & _
"<go href=""search.asp"" method=""post"">"
& vbCrLf & _
"<postfield name=""qt"" value=""ln""/>"
& vbCrLf & _
"<postfield name=""qv"" value="""
& qv & """/>" & vbCrLf &
_
"<postfield name=""pid"" value="""
& rs.Fields("phone_id")
& """/>" & vbCrLf & _
"</go>" & vbCrLf & _
"</anchor>"
End If
End If
%>
</p>
</card>
</wml>
<%
On Error Resume Next
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者