Preliminary WAP wml+asp Query

Source: Internet
Author: User

Program Purpose: The job needs, inquires the enterprise registration data friend too many, saves the trouble, has added the inquiry function on the website, actually some people say has no computer, no computer also should have a mobile phone. Use mobile phone query so anytime and anywhere, say dry, do a WAP query, all written in Notepad.

The database structure is as follows:

Library Name: Data.mdb

Table Name: Info

Field: ID, business name, domicile, legal representative ... (this ellipsis is meant to wait)

One, Feedback page hello.asp

The source code is as follows:

<%@ Language=vbscript%>
<% response.contenttype= "TEXT/VND.WAP.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= "Qycx" title= "Shangrao Business Information Network" >

<p>
Please enter the query data <input name= "QYCX" type= "text" maxlength= "/>"
<anchor title= "OK" > OK
<go href= "qycx.asp" method= "POST" >
<postfield name= "Qycx" value= "$qycx"/>
</go>
</anchor>

<br/><br/>
Shangrao Industry and Commerce Information Network
</p>

</card>

</wml>



Second, the information receives the page qycx.asp

The source code is as follows:

<%@ Language=vbscript%>
<% Response.ContentType = "TEXT/VND.WAP.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= "qycx2" title= "Shangrao Business Information Network" >

<p>
<%
Qycx=request. FORM ("Qycx")
cx= "Business name like '% ' &qycx&"% "

Set conn=server.createobject ("Adodb.connection")
' Conn. Open "dsn=qycxsjk;uid=;p wd=;d Atabase=data.mdb"
Conn.Open "Driver={microsoft Access Driver (*.mdb)};d bq=" &server.mappath ("Qycx.mdb")

Sql= "SELECT * from info where" &cx& ""
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,conn,1,1
Do as not rs.eof
%>
<%qymc=rs ("Enterprise Name")
ID=RS ("id")

%>

<a href= "Qycx2.asp?id=<%response.write id%>" ><%response.write qymc%></a>

<br/>
<%
Rs.movenext
Loop
Rs.close
%>
<br/><br/>
Shangrao Industry and Commerce Information Network
</p>

</card>

</wml>
<% Function Uni (Chinese)
For i = 1 to Len (Chinese)
A=mid (Chinese, I, 1)
Uni=uni & "& #x" & Hex (AscW (a)) & ";"
Next
End Function
%>



=========================================================================

Second comment: see here, I'm a little sweat, just beginning with the "Enterprise name" as a keyword to submit, and then think of the ID as the keyword query to avoid the problem of Chinese character submission. So the foundation of a problem, I actually think about a long day. Here, according to the "Enterprise Name" keyword query submitted by hello.asp, get the full name of the enterprise containing the keyword in all enterprise name fields (lest repeat), make a list, click on the third page, that is, the enterprise details.



Third, qycx2.asp

The source code is as follows:

<%@ Language=vbscript%>
<% Response.ContentType = "TEXT/VND.WAP.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" >


<%
Set conn=server.createobject ("Adodb.connection")
' Conn. Open "dsn=qycxsjk;uid=;p wd=;d Atabase=data.mdb"
Conn.Open "Driver={microsoft Access Driver (*.mdb)};d bq=" &server.mappath ("Qycx.mdb")
%>




<wml>
<card id= "qycx3" title= "Shangrao Business Information Network" >
<p>
<%
Name=request.querystring ("id")





Sql= "SELECT * from info where id=" &name& ""

Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,conn,1,1
Do as not rs.eof
%>
<%qymc=rs ("Enterprise name")%>
Enterprise Name: <%response.write qymc%>
<br/>

<%zs=rs ("residence")%>
Residence: <%response.write zs%>
<br/>

<%fddb=rs ("legal representative")%>
Legal representative: <%response.write fddb%>
<br/>

<%zczb=rs ("Registered capital")%>
Registered Capital: <%
If left (zczb,1) = "." Then
Response.Write "0"
Else
End If
Response.Write zczb%> million
<br/>

<%qylx=rs ("Enterprise Type")%>
Enterprise Type: <%response.write qylx%>
<br/>

<%jyfw=rs ("Business scope")%>
Scope of business: <%response.write jyfw%>
<br/>

<%zcrq=rs ("date of establishment")%>
Registration Date: <%response.write zcrq%>
<br/>


<%
Rs.movenext
Loop

%>
<br/><br/>
Shangrao Industry and Commerce Information Network-end
<br/>
<a href= "Hello.asp" > Return </a>
</p>


</card>

</wml>




=============================================================================

OK, complete the query display details of the enterprise!

Do not write well, don't scold me. Hey, welcome to like WAP Friends can communicate with me more, guide! qq:18185813




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.