Hi
for this type ASP provide Paging . in this you have to define no of max. record
you want to show at a time , this is a property of recordset ,
yr case it will be 7 ....
i am giving the simple code read this .. or you can get lot of example in net
<[EMAIL PROTECTED]>
<%
' Define variables
dim recordsonpage, requestrecords, offset, allrecords, hiddenrecords,
showrecords, lastrecord, recordcounter, pagelist, pagelistcounter
' DB connection
dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("cddatabase.mdb") & ";" & _
"Persist Security Info=True"
Conn.Open(sConnection)
' records per page
recordsonpage = 10
' count all records
allrecords = 0
set rs = conn.Execute("SELECT * FROM cds")
do until rs.EOF
allrecords = allrecords + 1
rs.movenext
loop
' if offset is zero then the first page will be loaded
offset = request.querystring("offset")
if offset = 0 OR offset = "" then
requestrecords = 0
else
requestrecords = requestrecords + offset
end if
' opens database
set rs = conn.Execute("SELECT * FROM cds ORDER BY cdid")
' reads first records (offset) without showing them (can't find another
solution!)
hiddenrecords = requestrecords
do until hiddenrecords = 0 OR rs.EOF
hiddenrecords = hiddenrecords - 1
rs.movenext
if rs.EOF then
lastrecord = 1
end if
loop
%>
<html>
<head>
<title>CD Database</title>
<meta http-equiv="author" content="Tranzity">
</head>
<body>
<table cellspacing="2" cellpadding="2" border="1" width="400">
<%
' prints records in the table
showrecords = recordsonpage
recordcounter = requestrecords
do until showrecords = 0 OR rs.EOF
recordcounter = recordcounter + 1
%>
<tr>
<td><b><% = recordcounter %></b></td>
<td><% = rs("cdid") %></td>
<td><% = rs("title") %></td>
</tr>
<%
showrecords = showrecords - 1
rs.movenext
if rs.EOF then
lastrecord = 1
end if
loop
%>
</table>
<p>
<table cellspacing="2" cellpadding="2" border="1" width="400">
<tr>
<td><% if requestrecords <> 0 then %><a href="paging.asp?offset=<% =
requestrecords - recordsonpage %>">Prev Page</a><% else %>Prev Page<% end if
%></td>
<td><% if lastrecord <> 1 then %> <a href="paging.asp?offset=<% =
requestrecords + recordsonpage %>">Next Page</a><% else %>Next Page<% end if
%></td>
</tr>
<tr>
<td colspan="2">pagelist:
<%
pagelist = 0
pagelistcounter = 0
do until pagelist > allrecords
pagelistcounter = pagelistcounter + 1
%>
<a href="paging.asp?offset=<% = pagelist %>"><% = pagelistcounter %></a>
<%
pagelist = pagelist + recordsonpage
loop
%>
</td>
</tr>
</table>
<%
' Closes connection
rs.close
Conn.close
%>
</body>
</html>
Ghassan <[EMAIL PROTECTED]> wrote:
There's a friend who is working on a web that retrieves information
from an Oracle DB and display as a table, the thing is that the
information is huge, and the table seems endless, what's the best way
in ASP to divide this table each 7 columns for example with a
dynamically displayed next button in the bottom, create a new page,
put the next 7 columns in it, and so on.
By the way I'm kind of newbie, so kindly explain what for what in the
code.
Thanx in advanced
Ghassan Yonis
ASP Resources www.asp-dev.com
============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================
Yahoo! Groups SponsorADVERTISEMENT
document.write('');
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/asp/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'
[Non-text portions of this message have been removed]
ASP Resources www.asp-dev.com
============================================================
Learn over lunch. Get the developerWorks newsletter and
enjoy tools, code, and tutorials, along with your sandwich.
XML, Linux, Web services, Java -- and peanut butter!
http://www.topica.com/partner/AP-1RMZ49/partners/ibm/aff_landing.html
============================================================
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/asp/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/