<% select case xxx case "1" sqlq = "select * from link2 where keyword like '%" & search & "%' or description like '%" & seaRCH & "%' order by name"
case "2" aryKeywords = Split(search, " ")
sqlq = "select * from link2 where" For i = 0 To UBound(aryKeywords) SQLQ = SQLQ & tempJoinWord & "(" & _ "keyword LIKE '%" & aryKeywords(i) & "%' OR " & _ "description LIKE '%" & aryKeywords(i) & "%')" tempJoinWord = " OR " Next
sqlq = sqlq & "order by Name"
end select
CONN_STRING = "DBQ=" & Server.MapPath("/mypage/db/link.mdb") & ";" CONN_STRING = CONN_STRING & "Driver={Microsoft Access Driver (*.mdb)};" 'buil string for connection my database file is link.mdb in store in the same folder of this file.
Dim iPageSize Dim iPageCount Dim iPageCurrent Dim strOrderBy Dim strSQL Dim objPagingConn Dim objPagingRS Dim iRecordsShown Dim I
select case show case 10 iPageSize = 10 case 20 iPageSize = 20 case 30 iPageSize = 30
end select 'set page size
If Request.QueryString("page") = "" Then iPageCurrent = 1 Else iPageCurrent = CInt(Request.QueryString("page")) End If
If Request.QueryString("order") = "" Then strOrderBy = "id" Else strOrderBy = Request.QueryString("order") End If
' select sql from the table..my table in link.mdb name "link2"
Set objPagingConn = Server.CreateObject("ADODB.Connection") objPagingConn.Open CONN_STRING 'open connection
objPagingRS.Close Set objPagingRS = Nothing objPagingConn.Close Set objPagingConn = Nothing
If iPageCurrent <> 1 Then %>
<A HREF="./search.asp?page=<%= iPageCurrent - 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&search=<%=search%>&num=<%=show%>&xxx=<%=xxx%>"><font face="Tahoma" size="2"><--ÇáÓÇÈÞ</font></A> <% End If
If iPageCurrent < iPageCount Then %> <A HREF="./search.asp?page=<%= iPageCurrent + 1 %>&order=<%= Server.URLEncode(strOrderBy) %>&search=<%=search%>&num=<%=show%>&xxx=<%=xxx%>"><font face="Tahoma" size="2">ÇáÊÇáí--></font></A> </center> <% End If