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>