Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / General ASP Topics / July 2009



Tip: Looking for answers? Try searching our database.

Paging with ASP Classic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
news - 03 Jul 2009 01:45 GMT
Hello all;

 I have ran out of resources and thought that I would try my luck here.
Hopefully someone will have some information for me.

I need to do a paging system.
( I know how to do a basic paging system)
What I need is something like this.

1     5    9
2     6   10
3     7   11
4     8   12
exc.....

Where the records will run down 1 row for a set number
Then run down another row, then a 3rd row.
For a set number of records per page. Like maybe 25 - 30+ records per page.

I have a nice paging system in place now, that I can use, if I can get some
code to do this.

Any ideas on doing something like this?
Thanks all
Carrzkiss
Adrienne Boswell - 03 Jul 2009 04:32 GMT
> Hello all;
>
[quoted text clipped - 23 lines]
> Thanks all
> Carrzkiss

<html>
<head>
<title>Table</title>
</head>
<body>
<table>
<tr>
<td>
<% for i = 1 to 100
response.write  i & "<br>"
if i mod 20 = 0 then
response.write "</td><td>"
end if
next
%>
</td>
</tr>
</table>
</body>
Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

news - 03 Jul 2009 19:31 GMT
Hello Adrienne
Thanks a bunch for the example. Works great as is.
But how would I go about implementing a RecordSet into it?

Lets say that the RecordSet is:

objRs("MyField")

And have it go through and list all the records in the table for this field?

Thanks

----- Original Message -----
From: "Adrienne Boswell"

<html>
<head>
<title>Table</title>
</head>
<body>
<table>
<tr>
<td>
<%
for i = 1 to 100
response.write  i & "<br>"
if i mod 20 = 0 then
response.write "</td><td>"
end if
next
%>
</td>
</tr>
</table>
</body>
</html>
Evertjan. - 03 Jul 2009 21:03 GMT
news wrote on 03 jul 2009 in microsoft.public.inetserver.asp.general:

> Thanks a bunch for the example. Works great as is.
> But how would I go about implementing a RecordSet into it?
[quoted text clipped - 5 lines]
> And have it go through and list all the records in the table for this
> field?

I hate recordset use, why not simple sql?

You did not specfy the type of db engine.

I read somewhere:

"In MySQL, LIMIT x,y means skip the first x records,
and then return the next y records."

This would hice a nice solutiion:

sql= "SELECT .... LIMIT " & session("pointer") & ",10"

....

session("pointer") = session("pointer") + 10

===============================

If not available you could mimic this LIMIT by a double select

pseudocode:

SELECT FROM
(SELECT FROM db TOP " & session("pointer") + 10 & " desc)
TOP 10 asc

[nothing tested]

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

news - 03 Jul 2009 22:06 GMT
Hello "Evertjan."

Sorry for not mentioning.
(Tested on either) Access Database (or) SQL Server,  But will be used with
SQL Server.

I am not sure that I follow you on the session("Pointer")
Or how to use it with what I am needing.

The code supplied by: Adrienne Boswell
Seems to be what I need, but am having a hard time implemented it with a
database.

There is nothing available online for it.
Everything that you find online is either:

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15

(or)

1
2
3
4
5

And I am needing

1     5    9
2     6   10
3     7   11
4     8   12

Thanks a lot guys.
Adrienne Boswell - 03 Jul 2009 22:56 GMT
> Hello "Evertjan."
>
[quoted text clipped - 8 lines]
> Seems to be what I need, but am having a hard time implemented it with
> a database.

Change the i to whatever fields you are getting out of your recordset.

<html>
<head>
<title>Table</title>
</head>
<body>
<table>
<tr>
<td>
<%
'however you are looping through the recordset
for i = 1 to 100
response.write  field.value & "<br>"
if i mod 20 = 0 then
response.write "</td><td>"
end if
next
%>
</td>
</tr>
</table>
</body>

> There is nothing available online for it.
> Everything that you find online is either:
[quoted text clipped - 19 lines]
>
> Thanks a lot guys.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

news - 03 Jul 2009 23:51 GMT
(((Not sure if the last post went through or not)))

Hello Adrienne
Thanks for your reply.
I had already tried that as well as other things and this is what I get.

<%
While Not objRs.EOF and Count < objRs.PageSize
for i = 1 to 100
st = objRs("MyTitle")
response.write  st & "<br>"
if i mod 20 = 0 then
response.write "</td><td>"
end if
objRS.MoveNext
next
wend
%>

I get
5 Columns
100 Rows

So it is doing as the code originally wants, but ignoring the 20-rows
Here is the actual code with over a 1000+ intries in an Access Database to
test for yourself if you do not mind.
http://www.cffcs.com/Projects/ColumnsRows/Columns.zip

Wayne

"Adrienne Boswell" <arbpen@yahoo.com> wrote in message

> <html>
> <head>
[quoted text clipped - 17 lines]
> </table>
> </body>
Adrienne Boswell - 04 Jul 2009 19:26 GMT
Please don't top post.  Post correct, see bottom:

> "Adrienne Boswell" <arbpen@yahoo.com> wrote in message
>>
[quoted text clipped - 48 lines]
> Database to test for yourself if you do not mind.
> http://www.cffcs.com/Projects/ColumnsRows/Columns.zip

Wayne, I'm sorry, but I will not download a zip file. I'm sure you're a
very trustworthy person, but one can never tell.

How many records in pagesize? What 20 rows are you talking about?  
Change the order around:

<%
for i = 1 to 100
  While Not objRs.EOF and Count < objRs.PageSize
    st = objRs("MyTitle")
    response.write  st & "<br>"
    if i mod 20 = 0 then
      response.write "</td><td>"
    end if
    objRS.MoveNext
  wend
next
%>
      

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

news - 04 Jul 2009 19:48 GMT
Hello Adrienne
>>Wayne, I'm sorry, but I will not download a zip file.
Not a problem.

>>How many records in pagesize? What 20 rows are you talking about?

OK. Lets look at your code for a minute shall we?

<% for i = 1 to 100 ' How many records that we want to call to the page   #1
response.write  i & "<br>"
if i mod 20 = 0 then ' How many ROWS that we want to display.            #2
response.write "</td><td>"
end if
next
%>

#2 is the 20 Rows that I am referring to.

OK.
Now, to your newest code sample, does not work. Shows 1 complete line only.
If I only have 10 records in the PageSize, it will only show 10 in 1 Column.
If I have 100 in the PageSize, then it will show 100 in a complete single
Column.

So,  This code here is no good.
<%
for i = 1 to 100
  While Not objRs.EOF and Count < objRs.PageSize
    st = objRs("MyTitle")
    response.write  st & "<br>"
    if i mod 20 = 0 then
      response.write "</td><td>"
    end if
    objRS.MoveNext
  wend
next
%>

Have a good 4th of July.

Wayne
Adrienne Boswell - 04 Jul 2009 19:54 GMT
> Hello Adrienne
>>>Wayne, I'm sorry, but I will not download a zip file.
[quoted text clipped - 20 lines]
> in 1 Column. If I have 100 in the PageSize, then it will show 100 in a
> complete single Column.

Wayne, it's untested.  You'll have to play around with it until you get
it right.  Don't do it today, have some food, fireworks and maybe a
libation or two.  

> Have a good 4th of July.

Thanks, I'm going to.  Hope you have a happy 4th as well. But, don't
over do it on the libations if you want to get started back on your
project tomorrow.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

news - 06 Jul 2009 09:29 GMT
The weekend is over.
And I have almost completed my project, just need a few extra goodies done.
And this is one of them.

Adrienne
Do you think that you could assist me a little more with this issue please
if you have the time?

Hope you had a good 4th of July celebration, mine was spent here on the
system.
trying to get this thing completed.

Wayne
news - 16 Jul 2009 08:23 GMT
Hello "Adrienne Boswell"

Just wanted to check back with you on this one, And see if you had any
idea's on how to correctly
Implement this code with a database?

Have a good one
Evertjan. - 16 Jul 2009 11:38 GMT
news wrote on 16 jul 2009 in microsoft.public.inetserver.asp.general:

> Just wanted to check back with you on this one, And see if you had any
> idea's on how to correctly
> Implement this code with a database?

This one?

please always quote on usenet, or use email

Signature

Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

news - 18 Jul 2009 18:31 GMT
> This one?
>
> please always quote on usenet, or use email

Sorry.
I use Outlook Express as my News Reader, so everything is right here, did
not think about the outside programs
That do not group messages.

So, will quote from now-on.

Wayne
Adrienne Boswell - 19 Jul 2009 15:54 GMT
>> This one?
>>
[quoted text clipped - 6 lines]
>
> So, will quote from now-on.

Actually, it isn't so much about the news client as it is about the news
server.  Servers differ in what they retain, some servers retain
messages longer than others, so you might not be able to go back and see
the original message, but I might because my provider has longer
retention.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.