[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Recordset Paging not using .Move

Posted on 2009-02-08
5
Medium Priority
?
433 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
0
Comment
Question by:Martin Cotterill
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 23609917
SELECT fields FROM table WHERE id NOT IN(SELECT TOP 4 id FROM table)
0
 
LVL 1

Author Comment

by:Martin Cotterill
ID: 23621726
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

0
 
LVL 28

Accepted Solution

by:
sybe earned 2000 total points
ID: 23623019
> 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

0
 
LVL 1

Author Comment

by:Martin Cotterill
ID: 23625879
Hi Sybe

Excellent! Works perfectly! Many thanks!
0
 
LVL 1

Author Closing Comment

by:Martin Cotterill
ID: 31544231
Excellent! I also learnt something new.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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