All source code in ASP/ VbScript Ask a ASP/ VbScript Pro Discussion Forum Categories All jobs in ASP/ VbScript
Quick Search for:  in language:    
modified,some,database,paging,code,found,Plan
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 281,486. lines
 Jobs: 101. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login

NEW! LEARNING CENTER
Special educational offers, white papers, webcasts, podcasts

  NEW! Download Rational Performance Tester V8 (download now)
  NEW! Download Rational Functional Tester V8 (download now)
  NEW! Download Rational Service Tester for SOA Quality V8 (download now)
  NEW! Teleconference: Quality In Action - Using Rational Quality Manager with Functional, Performance and Web Service Testing Products (download now)
  NEW! Introducing IBM Rational AppScan Developer Edition – easing security testing by non-security professionals (download now)

 

 


Latest postings for ASP/ VbScript.
Click here to see a screenshot of this code!Mess Officer Management System (Sistem Pengurusan Mess Pegawai)
By Mohd Fauzi on 11/23

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   </tr>

Simplified Database Paging Example (MS Access/IIS)

Print
Email
 
winzip icon
Submitted on: 1/12/2001 12:54:53 PM
By: Daniel M. Hendricks  
Level: Beginner
User Rating: By 10 Users
Compatibility:ASP (Active Server Pages)

Users have accessed this code 24001 times.
 
author picture
(About the author)
 
     I modified some database paging code I found on Planet Source Code so that it was a little more straight forward. Included is a sample code file and a sample MS Access 2000 database. Paging allows you to display a specific number of records from a database at a time. For example, if you have 1000 records, you can allow it to display 10 records at a time so you don't have a huge page display. If you're smart, you can add sorting features like the ability to display records starting with 'A' only, but this will get you started.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 2 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
2/1/2001 8:58:59 AMViet

Hello again,
i have downloaded your code. It work well. but my question is: i would like to display all the fields of my table and not only the name field. Can you tell me how to do ?
Thanks a lot.

(If this comment was disrespectful, please report it.)

 
3/1/2001 11:17:48 PMDan Hendricks

If you want to display other fields, simply replace the 'name' portion of rs("name") with the name of the other fields you'd like to display. Here is an easy way to display ALL data in a simple table as well: set rs=db.execute("SELECT * FROM data") strTable = rs.GetString(,,"</td>
","
"," ")
(If this comment was disrespectful, please report it.)

 
3/2/2001 5:48:36 AMMax

i would like know how you would extend this paging table to include hyperlinks that takes the user to another pager and show all the details of selected record ?

IE The name Column may be a all hyperlinks and when selected they could show the full details such address, city etc.
Thanks
(If this comment was disrespectful, please report it.)

 
5/22/2001 3:12:57 AMJames Shepherd

It Seems that there might be a problem displaying large amounts of text. Can this be used to display a "MEMO" type field?
(If this comment was disrespectful, please report it.)

 
9/20/2002 3:29:54 PM

As I am rather new to ASP this code was easily implementable and understandable! I was able to follow the code and understand exactly what was going on and most importantly, why!

That said, would like to hyperlink the page numbers so that the user can click to the specific page in the results. Also, can this code be reformatted to be used on two pages instead of one page, (i.e. a send and receive page)? With the data for the sql from page-send and the processing and paging on page two?

Thank you.

Gail G.

(If this comment was disrespectful, please report it.)

 
10/9/2002 1:47:02 PMJon

A easy to use script
And setting it up on Forum was just as easy.
Excellent
(If this comment was disrespectful, please report it.)

 
1/1/2003 7:54:23 PM

how would i get the script to write an img from a database. The database stores a text string i.e. "me.jpg" yet when i try this and i cant get it to work: Response.Write .... etc ... & "<img src='rs('IMAGES')'> if anyone knows how to do this please contact me or post below
(If this comment was disrespectful, please report it.)

 
4/22/2003 4:32:44 PM

Excellent Script!

I added part of this script to an existing database and within 1/2 hour I had it up and running.

Minimal tweaking required.

Nice Job here.

5 Stars ***** and 2 Thumbs up!
(If this comment was disrespectful, please report it.)

 
10/7/2003 9:39:20 PM

Hi and thank's you for the code.
for some reason I get an error: Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
That referes to: rs.AbsolutePage = CurrentPage
How can I overcome that?
(If this comment was disrespectful, please report it.)

 
11/6/2003 9:04:07 AM

Hello,
I dont know if you or anyone else will be able to help with this, but I too am getting the same error:


(If this comment was disrespectful, please report it.)

 
11/6/2003 9:09:38 AM

Hello, im afraid that I too am getting the same error:
" Current
Recordset does not support bookmarks.
This may be a limitation of the
provider or of the selected
cursortype."

I have tried placing an ' on that line to remove the code and then the page loads but it loads all 350 records on the one page, it does then give me the link "Next" as an active link, but if I click it, there is nothing on that page, also the line about "Displaying page * of * " says it is displaying page 1 of 1. I am using the version of Access prior to Access 2000 and I think this may be why it is giving this error, but I cant use access 2000 for this application because I am editing an existing database application. Please could you let me know how to fix this error using an older version of Access?

Yours gratefully
CharitiesOnline
rs.AbsolutePage = CurrentPage

(If this comment was disrespectful, please report it.)

 
11/6/2003 11:35:12 AM

I have managed to get it sort of working, but when I click next or prev it loses the search info, & just lists all the record sets in the database (all 312 of them)! Please can anyone just correct the code for me so that this little error doesnt occur, and I will be well away!

code to follow


(If this comment was disrespectful, please report it.)

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2008 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.