oricteropo
IS-IT--Management
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?
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?