cancel
Showing results for 
Search instead for 
Did you mean: 

Recordset Navigation Help

Former Member
0 Kudos

Good Afternoon

Experts:

I have quite the dilemna this afternoon. My application performs a simple select all records from a table to initialize navigation...previous, next, first and last.

However, I now have added a routine to load the last viewed record, by the

logged on User, in the recordset. This now causes the original navigation

to not be in order.

My Question:

Is it possible to perform the select all records and then position a "cursor/index/reference starting point" to a value in that recordset?

Example:

Recordset returns:1,2,3,4,5,6,7,8,9...etc

LastViewed = 5 so base all navigation off of 5...6 next record, 4 is previous record

Thanks,

Ed

Accepted Solutions (1)

Accepted Solutions (1)

AlexGrebennikov
Active Contributor
0 Kudos

Hi Ed!

This is impossible to implement your issue using DI-RecordSet object, but as an option i could suggest you to implement it by stored procedure (T-SQL query) and execute it by DoQuery().

To do it you have to:

- be able to get the last viewed record by code (or T-SQL)

- use IDENTITY function to build an order you want

- use UNION operator to get <i>5,6,7,8,9,1,2,3,4</i> instead of <i>1,2,3,4,5,6,7,8,9</i>

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you for the reply.

I will be busy implementing the concept. While I fully understand your suggestions as a soultion, I have never has the opportunity to utilize this scenario. So, I may be asking another question if you do not mind.

Thanks,

EJD