Results 1 to 2 of 2

Thread: Findfirst in ADO

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000

    How to implement the findfirst method in ado?

    I want this to be present within a loop. So regardless of the earlier find, the current one should be able to start the search at the top and find a record.

    Pls tell me if there is any other way other than using the movefirst method before calling find method. Note that I have to work with recordsets only.


  2. #2
    Lively Member Surgeon's Avatar
    Join Date
    Oct 2000


    There is a little difference between DAO and ADO when it comes to "Find" methods. I quote form MS documentation :

    "DAO includes four find methods: FindFirst, FindLast, FindNext, FindPrevious. You choose which method to use based on the point from which you want to start searching (beginning, end, or curent record) and in which direction you want to search (forward or backward).

    ADO has a single method: Find. Searching always begins from the current record. The Find method has parameters that allow you to specify the search direction(adSearchForward, adSearchBackward) as well as an offset from the current record at which to beginning searching (SkipRows)."

    So, if you don't want to make a movefirst before searching, just set the offset to point to the begining of the recordset and then perform a forward search.
    I suggest you take a visit to
    where you'll find some good ADO vb code examples.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width