ASP Paging... With a twist

They have: 5,633 posts

Joined: Jan 1970

Hello,

I have a growing database and have a growing need for it to be automaticaly paged (say by 5 each page). I have come accross plenty of scripts that achieve this using different methods, but none of them specify witch collum in the database I need paged, exc. I want a specific option such as that because In one collum, the output will be linked, and the link will be based on that collum. Another, the collum will be turned into the source for a picture. I can achieve all of this without paging.... but with it?? Who knows! I work in ASP and microsoft access (mdb) but if anyone knows how to use dbf, that would be great.
(example DB)
Name|Description|Link|PictureLink
Woo|Great game!|http://www.sfg.com|http://sfg.com/sdf.gif
Zlio|FunFun|www.some.tv.gov.com.net|[url]www.some.tv.gov.com.net\sdfg.gif[/url]

I hope I made this as clear as possible,

Thanks.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Welcome to The Webaster Forums!

I'm sorry, but I'm afraid I don't know what the problem is. Paging data should have no effect on formatting the results returned in the recordset.

Where are you having difficulties?

Mark Hensler
If there is no answer on Google, then there is no question.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

You don't page fields. You page records within a recordset.
Paging results has no impact on formatting the results.

previous thread on how to page: http://www.webmaster-forums.net/showthread.php?threadid=15355

After you have your list of records for the page your currently viewing, you need to format your results. This means using Response.Write to print out the recordset information along with any HTML needed to "frame" the data.

For example, your image will look something like this:
Respone.Write "<img src=""" & objRS("image") & """ alt=""" & objRS("name") & """ />"
'

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 52 posts

Joined: Feb 2003

hint: with the ASP.NET framework you can set paging in as little as two lines of code, specifying the table, fields, etc.. into which columns. with databind() bam your done.

In ASP a good way is using a stored procedure / query from the database that returns n number of records into an array.

check out http://www.fourguysfromrolla.com

Aaron Elliott
forwardtrends.com

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

He has: 52 posts

Joined: Feb 2003

oh yeah sorry about that lol

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.