Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Search Engine... Order By.. Paging

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-16 : 00:34:03
Rami writes "I am trying to write a search engine but instead of using paging using numbers, I am trying to do:

PREVIOUS NEXT
" ' 0 1 2 3 4 5 6 7 8 9 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

If user clicks a char it will take them to that part of the
recordset, while maintaining the paging system, displaying 10 items per page.. ie if they click next for item D and there are only two items, it would display the 2 "D%" items and continue into the next char "E" for the other 8 items.

This is what I've done:

strSQL = "Exec spTmItemSearch"& args

Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.CursorLocation = adUseClient
objRS.CacheSize = 100
objRS.Open strSQL, Cnn, adOpenStatic

' used a filter to filter the character clicked on

if qAlpha<>"" then
objRS.Filter = "item_name LIKE '"&qAlpha&"%'"
end if

numPerPage = 10
objRS.PageSize = numPerPage
pgCount = cint(objRS.PageCount)

do while not objRS.EOF
'Display results...
Loop

This method filters out all the other characters when you click on one and redisplays the results without contnuing if the user clicks next or previous."
   

- Advertisement -