Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I am having a little trouble an

Status
Not open for further replies.

ktatpe

MIS
May 15, 2003
12
0
0
US
Hi, I am having a little trouble and was wondering if anyone could help. I wrote an asp page that executes a stored procedure to query a sql server database. The procedure returns a closed record object with the search results. The problem is I need to page through this recordset to display only 5 records at a time. However, I cannot use the stardard ADO PageSize, PageCount, or Absolute Page properties to return the results as there is no recordset object declaration. The code below is what I attempted to use to page, loop through and return a specified number of records based on a start and end index.
However this does not work.
Does anyone have any suggestions?

startRecordNum = 0
endRecordNum = 5
Do While Not rsSearchResults.EOF
and startRecordNum < endRecordNum
startRecordNum = startRecordNum + 1
 
hey ktatpe,
a couple of things. I'm not sure if it was just incomplete code that your displaying or if you might be new to asp so if some of the things I suggest are obvious, I apologize.

1) If I'm reading this right, you say that no rs object is declared yet in your &quot;do&quot; loop you're referencing rsSearchResults.EOF. To me, that's indicative of an rs instead of an array. that potentially could be the problem.

2) if the code posted is complete code for your &quot;do&quot; loop, there's no &quot;loop&quot; to complete the loop.

I'm barely beginning to use stored procedures stored procedures so hopefully if I'm wrong about the referencing of thersSearchResults.EOF I'll be forgiven. :)

hth


&quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top