Title: search and sort asp Access in Chinese pinyin by stabx, Third Edition
Body:
Quote:
Asp access pinyin order by shawl. Qiu
This version implements the functionality not implemented in the previous revision, that is, integrating URL query parameters.
Use select case.
Function:
1. One character can be searched for Chinese characters and English letters by letter.
2. Search by number only
3. Search for data that does not belong to Chinese characters, English letters, and numbers
4. View in ascending or descending order. View in ascending order before English, and view in descending order before Chinese characters.
The query URL is as follows:
./Array_py5.asp? Sortby = letterfirst & showby = B
./Array_py5.asp? Sortby = letterfirst & showby = 0
./Array_py5.asp? Sortby = letterfirst & showby = Other
Page Navigation:
Code:
Shawl. Qiu <shawl.qiuatgmail.com>
Green School | http://blog.csdn.net/btbtd/
2006-6-4
First sort: by letter, by pinyin
A B c d e f g h I j k l m n o p q r s t u v w x Y Z
0 1 2 3 4 5 6 7 8 9 Other
Code:
<% 'Shawl. Qiu code | <shawl.qiuatgmail.com> | Green School | http://blog.csdn.net/btbtd/
Sortby _ = request ("sortby"): showby _ = request ("showby ")
If showby _ = "" Then showby _ = "A" end if
If sortby _ <> "" then
If sortby _ = "letterfirst" then
Orderby _ = "ASC"
Else orderby _ = "DESC"
End if
Else sortby _ = "letterfirst": orderby _ = "ASC"
End if
Select case showby _
Case ""
Py = array ("A", "A", "8 ")
Case "B"
Py = array ("B", "eight", "wipe ")
Case "C"
Py = array ("C", "wipe", "Ride ")
Case "D"
Py = array ("D", "Ride", "goose ")
Case "e"
Py = array ("e", "goose", "fat ")
Case "F"
Py = array ("F", "fat", "Ga ")
Case "G"
Py = array ("g", "Ga", "ha ")
Case "H"
Py = array ("H", "ha", "machine ")
Case "I"
Py = array ("I", "I", "I ")
Case "J"
Py = array ("J", "machine", "coffee ")
Case "K"
Py = array ("k", "coffee", "pull ")
Case "L"
Py = array ("L", "pull", "pull ")
Case "M"
Py = array ("M", "audio", "hmm ")
Case "N"
Py = array ("N", "hmm", "oh ")
Case "O"
Py = array ("O", "Oh", "afraid ")
Case "P"
Py = array ("P", "fear", "Seven ")
Case "Q"
Py = array ("Q", "Seven", "ran ")
Case "R"
Py = array ("r", "ran", "sa ")
Case "S"
Py = array ("S", "sa", "he ")
Case "T"
Py = array ("T", "he", "dig ")
Case "U"
Py = array ("u", "U", "U ")
Case "V"
Py = array ("V", "V", "V ")
Case "W"
Py = array ("W", "dig", "West ")
Case "X"
Py = array ("X", "West", "Ah ")
Case "Y"
Py = array ("Y", "Ah", "turns ")
Case "Z"
Py = array ("Z", "turns", "do nothing ")
End select
Response. Write "first sort: <a href = ""? Sortby = letterfirst & amp ;"
Response. Write "showby ="
Response. Write showby _
Response. Write ""> by letter </a>, <a href = ""? Sortby = hanzifirst & amp ;"
Response. Write "showby ="
Response. Write showby _
Response. Write ""> by pinyin </a> <p/>"
Letters = "a B c d e f g h I j k l m n o p q r s t u v w x y z"
Numbers = "0 1 2 3 4 5 6 7 8 9"
For each letter in Split (letters)
Response. Write "<a href = ""? Sortby ="
Response. Write sortby _
Response. Write "& amp; showby ="
Response. Write letter
Response. Write "">"
Response. Write letter
Response. Write "</a>"
Next
Response. Write "<p/>"
For each number in Split (numbers)
Response. Write "<a href = ""? Sortby ="
Response. Write sortby _
Response. Write "& amp; showby ="
Response. Write number
Response. Write "">"
Response. Write number
Response. Write "</a>"
Next
Response. Write "<a href = ""? Sortby ="
Response. Write sortby _
Response. Write "& amp; showby = Other" "> Other </a>"
Response. Write "<p/>"
If CSTR (showby _)> CSTR (9) and CSTR (showby _) <> "other" then
SQL = "select * From ctarticle where (title between '" & py (1) & "' and '" & py (2) & "') or title like '"&_
PY (0) & "% 'order by title" & orderby _
Elseif CSTR (showby _) = "other" then
SQL = "select * From ctarticle where (title not between 'A' and 'do Region') and title like '[! A-z0-9] % 'order by title "& orderby _
Else SQL = "select * From ctarticle where title like '" & showby _ & "% 'order by title" & orderby _
End if
Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open SQL, mm_conn_string, 1
Response. Write Rs. recordcount
Response. Write "<p/> <ol>"
Do while not Rs. EOF
Response. Write "<li>"
Response. Write RS ("title ")
Response. Write "</LI>"
Rs. movenext
Loop
Response. Write "</OL>"
Rs. Close
Set rs = nothing
%>