Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
First, understand the principle.
1. Enter the text box to query the content.
2. Submit the query information to the page for processing.
3. The program page is mainly used to receive query information. Based on this information, a specific SQL query statement is called to obtain the query result and display it.
In fact, the main essence is the writing of SQL statements.
The previous extraction is "select * form whattable where id =" & id
Insert as "insert into whattable (xx_rs) values ('" & content &"')"
Delete as "delete from whattable where id =" & id
Change to "update whattable set xx_rs = '" & log_content & "'Where id =" & id
The query is "select * form whattable where xx_rs like '%" & wahtkey & "% '"
The following is an example to study
1. Create a zip table in the database zipcode. mdb.
Field id, type automatic number (keyword)
Field placename, type text
Field province, type text
Field zipcode, type text
Field borough, type text
2. Add database information content
Id, no need to add
City and City corresponding to placename
Province corresponding to province
Borough region ID
3. Connection file conn. asp
Db_path = "zipcode. mdb"
Set conn = Server. CreateObject ("ADODB. Connection ")
Connstr = "Provider = Microsoft. Jet. OLEDB.4.0; Data Source =" & Server. MapPath (db_path)
Conn. Open connstr
4. search. asp
<Form action = "search. asp" method = "post">
<Input type = "text" name = "zipcode">
<Input type = "submit" name = "submit" value = "search">
[Ctrl + A Select All tips: You can modify some code and then press run]
5. Information query page, which is also search. asp
<! -- # Include file = "conn. asp" -->
If request. form ("submit") = "search" then
Whatzip = request. form ("zipcode ")
Set rs = Server. CreateObject ("ADODB. Recordset ")
SQL = "Select * from zip where zipcode like '%" & whatzip & "% '"
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.