PDA

View Full Version : Navigating records (Microsoft Access)


andy106
09-16-2005, 02:21 PM
hi,

I have got 2 web pages (index01.asp and index02.asp). The first page (index01.asp) shows the first 5 records from a recordset and has a 'Next' link, to show the next 5 records. The problem is that i want that 'Next' link to view the next 5 records on my SECOND page (index02.asp). How do i do that?

I have tried adding 'index02.asp?' to the navigation button on the index01.asp page:

--------------------------------------------------------------
Next (index02.asp?<%=MM_moveNext%>)
--------------------------------------------------------------

- This doesnt seem to do anything apart from show the first 5 records of the whole database on the index02.asp page.

I have also tried to add a 'Go to related page' link:

-------------------------------------------------------------
<A HREF="index02.asp?<%= Server.HTMLEncode(MM_keepURL) %>">
-------------------------------------------------------------

- I have a little more success with this, but index02.asp shows the same records that where on index01.asp, which isn't what i want. I want to see the NEXT 5 records, not the same ones.

I have tried adding'<%=MM_moveNext%>' to the code:

------------------------------------------------------------------
<A HREF="index02.asp?<%=MM_moveNext%><%= Server.HTMLEncode(MM_keepURL) %>">
------------------------------------------------------------------

- When I do this it doesn't even show the page when i click on the 'Next' link.

HELP!

thankyou

ranjan
09-16-2005, 05:18 PM
What you are trying to do does not make sense to me!

If I have 100 records with 10 records per page I can

a. build 10 static pages with 10 records each
b. build 1 dynamic page that pulls next 10 records based on URL parameters

What you are trying to do is built 10 dynamic pages with 10 records each...

Is that right? If so why?

andy106
09-20-2005, 09:11 AM
sorry, didnt explain it very well. I have sorted it out. basically i wanted to put 'enhanced listings' on the first page of the results page and 'normal listings' underneath. Both listings are coming from the same table, so i had to make 2 recordsets, where one recordset would filter only the enhanced listings and the other would show the rest of the listings. Now, all the enhanced listings would be shown on the first results page with the first 5 normal listings underneath and what i wanted to do also was click the 'next' link and on the next page only show the next 5 normal listings. On this second page their would only need to be 1 recordset to show the normal listings, but the problem was that i needed to show the NEXT 5 nomal listings. So, in other words i would have to pass a variable accross to the second page.

This is how i did it:

1. The NEXT link on the first results page had this code in it:

-----------------------------------------------------------------
index02.asp?offset=5&title=<%=Request("Search")%>
-----------------------------------------------------------------

2. And on the second results page i requested a variable called 'title'