?? filter.asp
字號:
<!--#include file="conn.asp"--> <%'包含conn.asp文件,該文件用來打開Connection對象,
'使用Include文件可以免去在每個ASP程序中寫連接語句的麻煩%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>過濾器</title>
</head>
<body>
<%
Dim rs
Set rs=Server.CreateObject("ADODB.Recordset") '創建Recordset對象
rs.Open "eword",conn,1,1 '打開eword表
For strletter= 1 to 26 '重復過程26次,一次針對字母表中的一個字母
strChar = Chr(strletter+64)
strSQL = "word LIKE '"&strChar&"*'" 'strSQL變量存放包含過濾條件的串,word為列名
rs.Filter=strSQL '使用過濾器過濾記錄集
If Not rs.Eof Then
Response.Write"<h2>" & strChar & "</h2>" &_
"<Table Border=1><TR><TD><B>English<b></td><TD>Mean</td></tr>"
Do While Not rs.Eof 'Eof屬性為True表示記錄集中沒有數據,此時不顯示任何內容
Response.Write "<TR><TD>" & rs("word") & "</td>" &_
"<td>" & rs("mean") & "</td></tr>"
rs.MoveNext
Loop
Response.Write"</table>"
End If
Next
Set rs=Nothing '關閉Recordset記錄集
Set conn=Nothing '關閉Connection記錄集
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -