Important alert: (current site time 7/15/2013 11:20:24 PM EDT)
 

winzip icon

ADO Recordset Paging Wrapper

Email
Submitted on: 11/7/2002 10:48:32 AM
By: Primoris Software 
Level: Intermediate
User Rating: By 11 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 22328
(About the author)
 
     Break down large recordsets into simple pages without all of the math work! This simple class acts as a wrapper to hide the grunt-work of the ADO Recordset paging feature. PageSize and AbsolutePage are handled on the backend, and exposed in their place is an easy to use 2-D array that contains ONLY the values you need. The navigation controls are automatically handled, and a function is even included to display the page of results in tabular form for you! An example page is included to show how easy it is to start separating your recordset results into pages. This is also a good example of VBScript classes.

 
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 5 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
11/8/2002 6:25:59 AMGrahame Coyle

Excellent code and beatifully documented. One problem I'm experiencing is that I get an EOF / BOF error when trying to access record 1560. Any ideas?
(If this comment was disrespectful, please report it.)

 
11/8/2002 9:15:46 AM

This code works great with IIS 5.1 but in my W2K Server i got Type mismatch in 'aryFields' line 54. Somebody can explain this ?


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

 
11/8/2002 12:56:44 PMPDearmore

Grahame, how do you mean that you are accessing the record? For normal use, you should never have to touch the Recordset member of the DataPage object. If you're getting that on one of the arrays, maybe the problem is because the array indexes are zero based, so rec # 1560 would be one higher than the valid range.
(If this comment was disrespectful, please report it.)

 
11/10/2002 11:10:59 AMknowntobe

Hi, great code!!!
Just one question. On one of my SQL databases I get the following error.

"Microsoft VBScript runtime error '800a000d'
Type mismatch
/DataPage.asp, line 167"
line 167 being
"strReturn = strReturn & aryRecordset(J, I)"

any ideas???
ps 5 globes from me
(If this comment was disrespectful, please report it.)

 
11/12/2002 8:52:33 AMPDearmore

Note to users: The above problem was because of a non-standard datatype (image) in the results. For now, if you get that message, put On Error Resume Next in the function causing the error. This will render a blank table cell where the image would be.
(If this comment was disrespectful, please report it.)

 
2/2/2003 12:17:29 PMlorenzo

getting an error I've never seen before:

Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
/pagewrapper/DataPage.asp, line 50

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

 
2/4/2003 1:19:55 AM

When i run, i get this error.
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'aryFields'
/DataPage.asp, line 55

Anyone can help me?
(If this comment was disrespectful, please report it.)

 
2/19/2003 2:53:24 AMmiracl

when you do that, at the begginning is it supposed to import all constant or something like that ?
(If this comment was disrespectful, please report it.)

 
2/19/2003 6:39:54 AM

Hi,
I get the same error :

"Microsoft VBScript runtime
error '800a000d'
Type mismatch:
'aryFields'
/DataPage.asp, line 55 "

Anyone can help me?

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

 
2/19/2003 9:23:02 AMFrank Ramos

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

 
3/26/2003 7:12:50 PM

The code works great and I truly appreciate the author being so kind as to share.
(If this comment was disrespectful, please report it.)

 
5/15/2003 12:03:24 PM

great code that's easy to reuse for anything (ie: search engine results, etc), but i corrected a bug.

when a user entered 0 or a string (instead of a number) into the small input field for the number of recordsets to show per page, there was an error. so i changed the original code in DataPage.asp, at about line 48:

If intPage = "" Then Page = 1
'tom - fix for when someone has entered a non-int into the field
If IsNumeric(intSize) <> true Then
Size = 25 'SETS THE DEFAULT NUMBER OF RECORDSETS TO SHOW PER PAGE if size chosen was not a number
ElseIf intSize = "" or intSize < 1 Then
Size = 25 'SETS THE DEFAULT NUMBER OF RECORDSETS TO SHOW PER PAGE if size chosen was empty or less than 1
End If
(If this comment was disrespectful, please report it.)

 
11/9/2004 9:10:11 AM

Thanks for the code. I truly appreciate your work. The code is workig well for me.
(If this comment was disrespectful, please report it.)

 
7/5/2012 6:31:49 PMMichael Voto

I wonder if anybody has found a workaround to Msado15.dll in windows 7. This code works really well in XP, however, with Windows 7 IIS does not work. Any help would be appreciated.
(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.