Important alert: (current site time 7/15/2013 11:39:17 PM EDT)
 

winzip icon

Paging in MySQL and ASP

Email
Submitted on: 8/12/2004 8:04:11 PM
By: snowboardr 
Level: Intermediate
User Rating: By 7 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 16733
(About the author)
 
     This a simple way to page in MySQL, its hard to find how to do this in MySQL and ASP so I wrote it and am now sharing it with you! It is my second post regarding MySQL. If you would like to learn how to setup MySQL and import an exsisting Access database you may find it here: http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=7739&lngWId=4 Please leave any comments if you find this code useful! Thanks for stopping by.. -Jason

 
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 21 submission(s) by this author

 


Report Bad Submission
Use this form to tell 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 Intermediate 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

8/13/2004 1:53:44 PMEd Ruth


Nice job...we don't see enough about using MySQL with ASP on this site. I hope we see more submissions of this type.

5 from me!


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

 
8/15/2004 12:38:06 AM

Glad to see you got the LIMIT in there. That is a huge advantage over MS SQL when paging through lots of records. Only way to do it when the webserver is not on the same machine as the database server.
(If this comment was disrespectful, please report it.)

 
8/15/2004 7:48:46 AMsnowboardr

The limit statment, has been very, very valueable in my time using MySQL and ASP. I highly doubt I would change databases, unless it was moving up to oracle sometime in the future....
(If this comment was disrespectful, please report it.)

 
5/16/2008 4:17:41 AMkensky

Nice Posting 5 Globes from me.
(If this comment was disrespectful, please report it.)

 
12/12/2009 2:28:32 AMHyourinmaru

nice code.. can i ask i got a error pointing at

sProjectCount = rsCount.RecordField(0) 'number of records

i change it to

sProjectCount = rsCount.RecordCount 'number of records

but the records give a value of -1..

can someone help me with my problem..



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

 
9/1/2010 5:05:52 AMNitesh Rajgopal & Avendra Surjooram

excellent code. I was stressing about how to get paging working on my website until I found this article. i'm very happy with paging now. thanks alot
(If this comment was disrespectful, please report it.)

 
3/11/2013 1:19:49 PM Ravichandran

Hi,
What if the table contains thousands of rows? Will the page numbers fill all over?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.