Find First, Find Next, Find Previous, Find Last

Find First, Find Next, Find Previous, Find Last

Post by Ronne » Sat, 14 Sep 2002 10:34:42



Hi,

I'm trying to migrate some code using the OO4O objects of Oracle to
ADO.  In Oracle, the Dynaset has 4 methods to find data : FindFirst,
FindNext, FindPrevious and FindLast.  No simple Find method.

The code I have to migrate use those 4 methods and I'm not sure if I
understand right, but I think FindFirst find the first row in the
dynaset matching the criteria.  FindLast the last one forward.
FindNext, the next one starting at the current row and FindPrevious,
the previous starting at the current row.  

I don't know how to implement it with ADO.  I know I can set an option
to backward or forward.  But is there an quivalent to FindLast or
FindFirst?

Thanks for your help

Ronney

 
 
 

Find First, Find Next, Find Previous, Find Last

Post by Val Mazu » Sat, 14 Sep 2002 21:07:13


Hi,

You would need to implement that functionality using Find method with
different options. To find first matching record you would need to use Find
method with specifying of bookmarks for first record

MyRecordset.Find "search criteria here", , adSearchForward, bookmark here to
the first record in recordset

to find last record

MyRecordset.Find "search criteria here", , adSearchBackward, bookmark here
to the last record in recordset

To find next record

MyRecordset.Find "search criteria here", , adSearchForward

To find perious record

MyRecordset.Find "search criteria here", , adSearchBackward

--
Val Mazur
Microsoft MVP


Quote:> Hi,

> I'm trying to migrate some code using the OO4O objects of Oracle to
> ADO.  In Oracle, the Dynaset has 4 methods to find data : FindFirst,
> FindNext, FindPrevious and FindLast.  No simple Find method.

> The code I have to migrate use those 4 methods and I'm not sure if I
> understand right, but I think FindFirst find the first row in the
> dynaset matching the criteria.  FindLast the last one forward.
> FindNext, the next one starting at the current row and FindPrevious,
> the previous starting at the current row.

> I don't know how to implement it with ADO.  I know I can set an option
> to backward or forward.  But is there an quivalent to FindLast or
> FindFirst?

> Thanks for your help

> Ronney


 
 
 

1. SQL Query question find next, find previous

Hi everybody,

I have a question regarding the "find previons" "find next" problem in
SQL databases.

Is there a way to find ONE row of a table when querying by index with
standard SQL?

Today I'm using cursors to hold the tuple and fetch forward 1 but this
is not very elegant, because the DBServer is overloaded when he has to
serve many connections. Storing the result in a Client local object is
also not an option, because one table has more than 10000 row's.

What would you recommend to solve the problem?

Please give me a hint and, if possible, some link's to literature or
websites.

Thank's,

Steffen Krug

2. anybody else running Ingres 2.5/0011 on Solaris 5.8?

3. PL/SQL cursor -- find first, next, prev and last

4. OLE Problem in VFP3 and Excel7.0

5. Find, Find Next

6. Summary Table from Detail Data

7. Find / Find next routine using ADO

8. Cold Fusion width

9. Find and Find Next in TDBGrid

10. gp_dump: error in finding the last system oid: ERROR: get_relation_info: Relation 1262 not found

11. Find returns mostly blank fields for first found record (FMP5)

12. CDML Next and Previous Button within a found set

13. Find the last date in a field previous to today