473,503 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp paging db records

46 New Member
hai..how to do simple page paging using ms acess..anyone can help me
Nov 17 '07 #1
1 1241
CroCrew
564 Recognized Expert Contributor
Hope this helps~

Expand|Select|Wrap|Line Numbers
  1. <%
  2.     Set Conn = Server.CreateObject("ADODB.Connection") 
  3.     Conn.Open("dsn=xxx;uid=xxx;pwd=xxx;") ' The conection to your database.
  4.  
  5.     Set rsData = Server.CreateObject("ADODB.Recordset") 
  6.  
  7.     SQL = "SELECT * FROM YourTable"
  8.  
  9.     rsData.CursorLocation = 3
  10.     rsData.Open SQL, Conn 
  11.     rsData.PageSize = 10 ' Show this number of records per page.
  12.     intPageCount = rsData.PageCount
  13.  
  14.     SELECT CASE Request("xAction")
  15.         CASE "Beginning"
  16.             intpage = 1
  17.         CASE "Previous"
  18.             intpage = Request("intpage") - 1
  19.             IF intpage < 1 THEN intpage = 1
  20.         CASE "Next"
  21.             intpage = Request("intpage") + 1
  22.             IF intpage > intPageCount THEN intpage = IntPageCount
  23.         CASE "End"
  24.             intpage = intPageCount
  25.         CASE ELSE
  26.             intpage = 1
  27.     END SELECT 
  28. %>
  29. <html> 
  30.     <head>
  31.         <title>Example 02</title>
  32.         <SCRIPT LANGUAGE="JavaScript">
  33.             function MoveTopage(xAction)
  34.             {
  35.                 document.xform.xAction.value=xAction;
  36.                 document.xform.submit();
  37.             }
  38.         </SCRIPT>
  39.     </head>
  40.     <body>
  41.         <%rsData.AbsolutePage = intPage%>
  42.         <%For intRecord = 1 To rsData.PageSize%>
  43.             <tr><td><%response.write(rsData("FieldWithinYourTable"))%></td></tr>
  44.             <%response.flush%>
  45.             <%rsData.MoveNext%>
  46.             <%If rsData.EOF Then Exit For%>
  47.         <%Next%>
  48.         <tr>
  49.             <td align="center">
  50.                 <input type="button" value=" &lt;&lt; " onclick="MoveTopage('Beginning');">
  51.                 <input type="button" value=" &lt; " onclick="MoveTopage('Previous');">
  52.                 <input type="button" value=" &gt; " onclick="MoveTopage('Next');">
  53.                 <input type="button" value=" &gt;&gt; " onclick="MoveTopage('End');">
  54.                 <br>Page: <%response.write(Intpage & " of " & intpagecount)%>
  55.             </td>
  56.         </tr>
  57.         <form name="xform" id="xform">
  58.             <input type="hidden" name="xAction" value="">
  59.         </form>
  60.     </body>
  61.  
  62.  
Jan 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3822
by: Navin | last post by:
HI, Guys There has been a lot of Ways to use paging in asp 1>Recordset approach -where whole records are pulled at client side... and then only the records which are needed are filtered.. and...
4
1716
by: david | last post by:
Hi I have written code in ASP for paging records from the database (SQL Server 2000). The real problem I have around 10,000 records and it tries to fetch all the records everytime (I'm saying...
6
1801
by: Shawn | last post by:
Hi. I already have a datagrid where I'm using paging. I have a stored procedure that fills a temp table with 200-500 rows and then sends back 10 records at the time. When I go to page 2 the SP...
2
2211
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
3
2121
by: nyhetsgrupper | last post by:
Hi everyone, In a datagrid the entire data is read but only the page you want is displayed to the user when you enable paging. Does the Gridview control works in the same way? So if you have...
1
4136
by: rbg | last post by:
I am using derived tables to Page data on the SQL Server side. I used this link as my mentor for doing paging on the SQL Serverhttp://msdn2.microsoft.com/en-us/library/ms979197.aspx I wanted to...
8
2789
by: rbg | last post by:
I did use query plans to find out more. ( Please see the thread BELOW) I have a question on this, if someone can help me with that it will be great. In my SQL query that selects data from table,...
2
1914
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
3
3731
by: Ronald S. Cook | last post by:
I was told that if calling lots of records from the database (let's say 100,000), that the GridView's paging feature would automatically "handle" everything. But the 100,000 records are still...
8
1440
by: Donald Adams | last post by:
I heard in an online video by Scott Gu, that there is an option to have the asp.net datagrid in .net 2.0 do the paging in SQL Server 2005 rather than pull all the data from the database and do it...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.