Connected Recordset

  • Thread starter Thread starter Bob The Builder
  • Start date Start date
B

Bob The Builder

I am emulating the old connected recordset of the ado days using a
static connection to the db and a cursor in my vb.net application. The
cursor is opened as a "scroll keyset" because I need to be able to jump
around to any record at any time and the "cursor threshold" is set to
5000. Unfortunately, I only get back one record. If I set "cursor
threshold" to -1, I get back all 171,000. Basically, I want to get the
first 5000 records and return control to the application. I can't do a
"SELECT TOP 5000" either because then the cursor will be limited to
5000 records and other aspects of the application will fail. MS has
provided us a wonderful capability with asynchronous cursor population,
but no decent way to use it. Thanks for your help
 
With the caveat that I have no applications where I would be interested in
replicating ADO classic, couldn't you set the cursor as a dynamic cursor? I
will note that in my ADO classic apps, I almost never used a keyset cursor,
rarely used a dynamic cursor, sometimes used a forward-only cursor, but
most often used a static cursor.
 
It needs to be a keyset cursor because that allows MOVE ABSOLUTE to
jump to specific records. The cursor is bound to a grid, and if the
user grabs the scrollbar and runs to record 287,000, I don't want to
call MOVE NEXT 286,999 times.
 
Back
Top