Results 1 to 4 of 4

Thread: pageSize without RecordSet - is it possible ??

  1. #1

    Thread Starter
    Member shamloo's Avatar
    Join Date
    Oct 2000
    Location
    Stockholm, Sweden
    Posts
    32

    Exclamation pageSize without RecordSet - is it possible ??

    Hi, Im making myself a webBoard(that works like this one) in asp and things are going pretty well.
    BUT, I have now bumbed into a problem that I need help with.

    First, read and try to understand what want to achive:

    strSQL="SELECT (SELECT Forums.Threads FROM Forums WHERE Forums.ID="& Forum &") AS ThreadsCount,"&_
    "Threads.ID,Threads.Title,Threads.Author,Threads.LastPostDate,Threads.Status,Threads.DatePosted, Threads.Replies, "&_
    "(SELECT Users.UserName FROM Users WHERE Users.ID=Threads.Author) AS ThreadAuthor "&_
    "FROM Threads WHERE Threads.Forum="& Forum


    this SQL-code fetches the data I want to display on the page where I list all threads, and
    it's here my problem is. I do not want ALL threads on one page, after a while it will be full with threads
    and if I have let's say 600 threads, the page will be very long, and it will take a while loading it.

    So, this is what I want to achive:
    I want to display 50 threads a page, and at the bottom it should say something like:
    page 1, 2, 3, 4 next>>
    I think you get the idea, you can find it almost everywhere!

    How do I make this happen if I do NOT want to use objRS.pageSize = x ?
    I was more thinking of using 'BETWEEN x AND y' in my SQL-statement but when I do that I get
    nowhere near my vision.

    the big question is, can this be done or should I choose the other path ?

    thanks,
    David
    "There are no must's in life unless you provide for someone else than yourself"

  2. #2
    Lively Member
    Join Date
    Jan 2001
    Posts
    118

    good question

    Give each thread an autonumber. Then show only number between 1 and 10, and 11-20 etc.

    It should work. Just past the number of the thread to the next page.

  3. #3

    Thread Starter
    Member shamloo's Avatar
    Join Date
    Oct 2000
    Location
    Stockholm, Sweden
    Posts
    32
    I can't get this to work!
    Say that I want to display all first 30 messages and if you click on a link further down on the page where it says:
    page 1, 2, 3, 4, 5, 6... (if you click on page 2, you would see the next 30 messages and so on).

    but now Im really stuck and have been so for the last 2 or 3 days!

    yepp, I still need help with this.
    how in the world should my SQL-code look like ??

    I've attatched a screenshot of the table called 'Threads' from the database and the code that should display the threads.

    the screenshot of the table
    and my SQL-code on the page that lists the threads:
    Code:
    strSQL="SELECT (SELECT Count(*) FROM Forums WHERE Forums.ID="& Forum &") AS ThreadsCount,"&_
           "Threads.ID,Threads.Title,Threads.Author,Threads.LastPostDate,Threads.Status,Threads.DatePosted, Threads.Replies, "&_
    	   "(SELECT Users.UserName FROM Users WHERE Users.ID=Threads.Author) AS ThreadAuthor "&_
           "FROM Threads WHERE Threads.Forum="& Forum &"
    someone must be able to help me !!
    /David
    "There are no must's in life unless you provide for someone else than yourself"

  4. #4

    Thread Starter
    Member shamloo's Avatar
    Join Date
    Oct 2000
    Location
    Stockholm, Sweden
    Posts
    32
    please ignore this thread unless you want to see how I solved it.
    If you would like to know, then reply and I'll give you my sollution
    /David
    "There are no must's in life unless you provide for someone else than yourself"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width