?
Solved

Spliting search reasults - asp

Posted on 2004-08-24
6
Medium Priority
?
280 Views
Last Modified: 2010-04-17
Hi experts,

could you tell me how to display search results on different pages? For example, one result on one page. What is the code that I must insert? Im using ASP to do the coding.
0
Comment
Question by:blurSoul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 11878594
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 11878596
//code by  thunderchicken
<html><head>
<title>Paging of a Recordset</title>
</head><body>

<%
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
    intPage = 1
End If

Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT LinkURL FROM Links"
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("/aspdigital/db/demo.mdb")
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
    rs.PageSize = 10
    rs.AbsolutePage = intPage
    intRecCount = rs.PageSize
    intPageCount = rs.PageCount
    Response.Write "<p><b>Side " & intPage & " af " & intPageCount & "</b></p>"
    Do While Not rs.EOF And intRecCount > 0
        Response.Write rs("LinkURL") & "<br>"
     intRecCount = intRecCount - 1
     rs.MoveNext
    Loop
End If
rs.Close
Set rs = Nothing

Response.Write "<p>Here "
For intNum = 1 To intPageCount
    Response.Write "<a href=paging.asp?page=" & intNum & ">" & intNum & "</a> "
Next

Response.Write "<p>"
If Cint(intPage) > 1 Then
    Response.Write "<a href=paging.asp?page=" & intPage - 1 & ">&lt;&lt;</a>"
Else
    Response.Write "&lt;&lt;"
End If

Response.Write "&nbsp;"

If CInt(intPage) < Cint(intPageCount) Then
    Response.Write "<a href=paging.asp?page=" & intPage + 1 & ">&gt;&gt;</a> "
Else
    Response.Write "&gt;&gt;"
End If
%>

</body></html>
0
 

Author Comment

by:blurSoul
ID: 11878624
lol thats a lot of code. Are all needed? I've already opened recordset and all...

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Expert Comment

by:sajuks
ID: 11878891
Its one thats been used.
Hang around and you might get better ones :-)
0
 

Author Comment

by:blurSoul
ID: 11888751
I think I'll just use it as you said it has been used. Believe it works.

Thanks for your help ;>
0
 
LVL 33

Expert Comment

by:sajuks
ID: 11888990
Thanks for the points and grade
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Make the most of your online learning experience.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question