We help IT Professionals succeed at work.

Recordset Paging not using .Move

Medium Priority
442 Views
Last Modified: 2012-05-06
Hi Experts

When we only had 15 or 20 messages we didn't need to use Recordset Paging in Dreamweaver. Now that figure is rising, I have added paging to our pages. However, this has caused a problem.

We have a side menu that has links to the first four messages in the table and another link to a page which shows all the messages except the four in the side menu. This was done by replacing 'numRows = 0' with '...Move...' ie:

     Set rsContent = rsContent_cmd.Execute
     ' rsContent_numRows = 0
     rsContent.Move 4

Now that I've introduced Recordset Paging, it is returning all records including the four in the side menu.

How can I show all the messages except the first four and still use Recordset Paging?

Hope this makes sense.

P
Comment
Watch Question

Commented:
SELECT fields FROM table WHERE id NOT IN(SELECT TOP 4 id FROM table)

Author

Commented:
Hi Sybe

Thanks for the reply and please accept my apologies for taking so long to get back to you.

I've tried you code by unfortunately it doesn't seem to work.

I've attached the code I'm using so you can tell me if I've got it right.

Regards

Martin
SELECT *
FROM tblMessages
WHERE siteSection = '20years' AND Display = True AND MessageID NOT IN (SELECT TOP 4 MessageID FROM tblMessages)
ORDER BY MessageID DESC

Open in new window

Commented:
> ORDER BY MessageID DESC

If that is the order you display them (newest first) you also have to include that in the substatement/
SELECT *
FROM tblMessages
WHERE siteSection = '20years' AND Display = True AND MessageID NOT IN (SELECT TOP 4 MessageID FROM tblMessages ORDER BY MessageID DESC)
ORDER BY MessageID DESC

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Hi Sybe

Excellent! Works perfectly! Many thanks!

Author

Commented:
Excellent! I also learnt something new.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.