%
strAction = Request.QueryString("Action")
Search = Request("SearchString")
Dir = Request.QueryString("Dir")
Pointer = Request.QueryString("Pointer")
If Search <> "" Then
If Session("Search") <> Search Then
Session("Search") = Search
End If
End If
iCounter = 5
iCounted = 0
Select Case Dir
Case ""
Pointer = 0
Case "For"
Pointer = Pointer + iCounter
Case "Rev"
Pointer = Pointer - iCounter
End Select
If strAction = "search" then
'Initialize the recordset
Set oRS = Server.CreateObject("ADODB.RecordSet")
Set oRSCount = Server.CreateObject("ADODB.Recordset")
'Filter the record set
SQL ="SELECT * FROM Products_Search WHERE Name LIKE '%" & Session("Search") & "%' OR Description LIKE '%" & Session("Search") & "%'" 'Note that products is a view!!!!
SQL2 = "SELECT Count(*) as Counted FROM Products_Search WHERE Name LIKE '%" & Session("Search") & "%' OR Description LIKE '%" & Session("Search") & "%'"
'Open the recordset
oRS.Open SQL, oConn
oRSCount.Open SQL2, oConn
Else
'Get the catalog
If Cat = "" Then
Cat = Request.QueryString("cat")
End If
If SubCat = "" then
SubCat = Request.QueryString("sub")
end if
If cat <> "" then
'Initialize the recordset
Set oRS = Server.CreateObject("ADODB.RecordSet")
Set oRSCount = Server.CreateObject("ADODB.Recordset")
'Filter the record set
If SubCat = "" then
SQL ="SELECT * FROM Products WHERE Products.CategoryID=" & Cat & "order by name " 'Note that products is a view!!!!
SQL2 = "SELECT Count(*) as Counted FROM Products WHERE Products.CategoryID=" & Cat 'Note that products is a view!!!!
Else
SQL ="SELECT * FROM Products WHERE Products.CategoryID=" & SubCat & "order by name " 'Note that products is a view!!!!
SQL2 = "SELECT Count(*) as Counted FROM Products WHERE Products.CategoryID=" & SubCat 'Note that products is a view!!!!
End If
'Open the recordset
oRS.Open SQL, oConn
oRSCount.Open SQL2, oConn
eND iF
End If
If NOT (oRS.EOF = True AND oRS.BOF = True) then
%>
| "> | |||||||||||||||||
|
|
||||||||||||||||
| <% If Not Bor = True then %> << Previous 5 <% End If %> | <% If Not Eor = True then %> Next 5 >> <% End If %> |