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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Efficiently return single page of a multiple page recordset

Status
Not open for further replies.

oricteropo

IS-IT--Management
Mar 7, 2003
29
US
I have a paged recordset in a DLL. It is a private variable and cannot be changed to public. I have a function which allows a user to specify a page of the recordset, and pass in an ADODB.recordset by reference and it will return that page of the recordset to them.
In order to return the recordset for only the single page I use the following code:

Set PassedInRS = New ADODB.Recordset
For Each fld In PagedRS.fields
PassedInRS.fields.Append fld.Name, fld.Type, fld.DefinedSize, fld.Attributes

Next

rsResult.Open

Do While PagedRS.AbsolutePage = RequestedPage And Not PagedRS.EOF
PassedInRS.AddNew
For Each fld In PagedRS.fields
PassedInRS(fld.Name).Value = PagedRS(fld.Name).Value
Next
PagedRS.MoveNext
Loop


Is there any way that I can more efficiently return a single page without making PagedRS public?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top