PDA

Click to See Complete Forum and Search --> : SQL and database question


Dec 28th, 2000, 03:22 PM
I can't seem to figure this out.

There are many websites on the net that use this feature. I am working on an e-commerce site, and there will be hundreds of items in seperate categories. Each category will have it's own asp page. So, for example, you click on "Women's Shoes", then the "wshoes.asp" page is opened. Now here's what I can't figure out...

The "wshoes.asp" page loads a table in which there are individual cells, and each cell holds the item information for each shoe in the database. Right now, I have it that it just loads every single shoe item that is in the "WomenShoes" table in the database. This is not good because if there were to be 300 shoe items, then the surfer would have to wait for the whole page to load. I want to make it so that there are 5 pairs of shoes per page. And at the top of the page, there are the links "Previous 5" and "Next 5". And if the user is at the beginning of the database, then it should not show the "Previous 5" link (and if it's at the end then it shouldnt show the "Next 5" link). This is pretty much what almost every e-commerce site has these days... and I need to know how to do this.

Please Help...

-Simon Bingier

Dec 28th, 2000, 05:22 PM
I did try to do this a while ago but never figured it out... I think it has something to do with the PageSize, PageCount and AbsolutePage properties of the ADO Recordset object but I got bored before it made any sense.

If you look at my guest book (there's a link in my signature) you'll see that I need to do the same thing...it's not too bad in my case because there aren't too many entries, but soon I can see it becoming a problem.

In the mean time you could seperate every 10 or so records into seperate html tables on your page...that would make the page appear to load faster...at least the user wouldn't be staring into space waiting for the whole table to load.

If you figure it out let me know :)

Dec 29th, 2000, 03:50 AM
Ok the pagesize property sets the number of items per page so for you
objrs.Pagesize=5
currentpage=request("curpage") will have already been incremented or decremented by the previous page
objrs.absolutepage= currentpage

Or something like that sorry still a bit rusty

Dec 29th, 2000, 05:23 PM
Cool, I'm gonna try it out...