Consulting

Results 1 to 3 of 3

Thread: ADO recordset search

  1. #1

    ADO recordset search

    I'm using EXCEL 2003 writing VBA code and using Access database
    In DAO, the Seek method for recordset, is used as a filter to search specific records within the current recordset. (Instead of running another SQL query in a database, I wrould rather do a search within the recordset)
    In ADO, Seek method cannot be used with ADO. Is there a similar method to Seek that allows to search records within the ADO recordset??

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Jun 2007
    Posts
    150
    Location
    You can't SEEK, but you can FIND, FILTER and SORT.

    FILTER and SORT work just like adding additional WHERE or ORDER BY clauses to the SQL.

    FIND is a completely different beast: for one thing it only works on ONE column at a time, whereas FILTER conditions can be as complicated as any standard WHERE clause.

    FILTER is generally much faster then FIND:

    Although Find is appropriate in some situations, using it to locate records is generally very inefficient, both in terms of speed and memory use. Find works by examining each record in a Recordset for the criteria you give it after you have created the Recordset and retrieved all the data from your database. Retrieving lots of unwanted records, particularly down the wire from a server, when you are really interested in only a handful—or even worse, just one bit of data—creates a lot of unnecessary overhead. Unless you have a very compelling reason for using Find, I'd recommend using an alternative approach, like filtering your Recordset or using SQL, for serious performance gains.
    http://articles.techrepublic.com.com...1-1045830.html


    EDIT:
    For some reason, I use this website for reference, even though the information in it is completely redundant to whats on MSDN.

    http://www.w3schools.com/ado/ado_ref_recordset.asp

Posting Permissions

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