ADO FIND question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a VB program accessing non-indexed tables (by primary key). I'm using
the RECORDSET.OPEN / RECORDSET.FIND syntax, coupled with RECORDSET.MOVENEXT.

I would like to be able to stop the quesry when the last record with my
specified value is found. How can I do that when the field I'm using is not
indexed (even though it's a key field)?

Any insight would be appreciated.

Thanks!
 
My suggestion would be to stop doing what you are doing and write a query
that returns the exact rows you need. Also by definition your primary key
is indexed.
 
I'm using the word "indexed" to mean sorted in this case. The SQL tables
I've linked to have some of the key fields as *not* indexed, but they show as
keys. I can't use q query per se, as I have a great deal of custom
processing to do. I gather records from many datasets, and use that
information to populate others. Some of the data is one-to-one, and some is
one-to-many. I also have tests that need to be perfromed on the data, as well
as number-of-records-found counting as a data item for insertion into a field.

Thanks

Dennis
 
Dennis,

Although the following method will be slow it will accomplish what you are
after. Use the bookmark property to set a bookmark before each find after
eof is found go back to the bookmark:
Do Until Recordset.EOF
bookMark = Recordset.BookMark
Recordset.Find(...)
Loop

' Reposition the pointer to the last good bookmark
RecordSet.BookMark = bookMark

Dan
 
Back
Top