<% '----------------------------------------- Function GetConnection( Param ) Dim conn On Error Resume Next Set GetConnection = Nothing Set conn = Server.CreateObject("ADODB.Connection") If Err.Number <> 0 Then Exit Function conn.Open Param If Err.Number <> 0 Then Exit Function Set GetConnection = conn End Function '--------------------------------------------------- Function GetMdbRs( FileName, Source, Cursor, Password ) Dim conn, rs On Error Resume Next Set GetMdbRs = Nothing Set conn = GetMdbConnection( FileName ) If conn Is Nothing Then Exit Function Set rs = Server.CreateObject("ADODB.Recordset") If Err.Number <> 0 Then Exit Function rs.Open source, conn, Cursor, 2 If Err.Number <> 0 Then Exit Function Set GetMdbRs = rs End Function '----------------------------------------- Function GetMdbConnection( FileName ) Dim Provider, DBPath Provider = "Provider=Microsoft.Jet.OLEDB.4.0;" DBPath = "Data Source=" & Server.MapPath(FileName) Set GetMdbConnection = GetConnection( Provider & DBPath ) End Function '--------------------------------------------------- Function GetMdbRecordset( FileName, Source ) Set GetMdbRecordset = GetMdbRs( FileName, Source, 2, "" ) End Function '----------------------------------------- Keyword=Trim(Request("DQWORD")) IF Keyword ="XYZ" then SQL= "Select * From expression" & " where English Like 'X%' OR English Like 'x%' OR English Like 'Y%' OR English Like 'y%' OR English Like 'Z%' OR English Like 'z%'" Else SQL= "Select * From expression" & " where English Like '" & Keyword & "%'" End If set expressiondb = GetMdbRecordset("expression.mdb" , SQL) IF expressiondb Is Nothing Then Response.Write " GetMdbRecordset 呼叫失敗!" Response.End End IF %> 資料查詢-- 名詞解釋
A B C D E F G H I J K L M N O P Q R S T U V W XYZ


編號
KeyWord
中文譯名
解說
<% if expressiondb.EOF = False then expressiondb.MoveFirst num=1 while Not expressiondb.EOF if (num Mod 2)<>0 Then bgcolor="#F0F0F0" else bgcolor="#FFFFFF" end if %>
<%=num%> > <% Response.Write expressiondb("English")%> > <% Response.Write expressiondb("Chinese")%> <%=expressiondb("Content")%>
<% num=num+1 expressiondb.MoveNext Wend else Response.Write "

無相關資料

" end if %>