SEEK vs FIND vs FILTER


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SEEK vs FIND vs FILTER

  1. #1
    Dante Guest

    SEEK vs FIND vs FILTER


    I am using VB 6 SP3, OLEDB / ADO 2.1, and Oracle Database.

    I have a Client-side ADODB recordset and the recordset is displayed
    on a DataGrid.

    I want to search for a record in the recordset (and highlight the record
    found on the Grid), using TWO columns as search key.

    1) I tried using rs.Index and rs.Seek, but I got the message that the
    Provider does not support the Index method.
    (I think Index and Seek work only with Server-side recordsets;
    but a Server-side rs can't display records on a DataGrid)

    2) Find method is limited only to one search column

    3) So I used the Filter method :

    varBkMrk = rs.Bookmark
    rs.Filter = "COL1 ='" & strVar1 & "' and COL2 ='" & strVar2 & "'"
    if not rs.EOF then
    msgbox "Found"
    varBkMrk = rs.Bookmark
    else
    msgbox "not found"
    endif

    rs.Filter = ""
    rs.Bookmark = varBkMrk

    I have two problems with the Filter method :

    (a) the above code causes the Grid to "blink", because the filter will
    cause a
    single record display in the Grid, clearing the filter will display
    all but will move
    the pointer to the first record, and then rs.Bookmark=varBkMrk
    highlights the
    found record.

    (b) I am not sure if Filter is an efficient way of searching, especially
    if the
    recordset is large

    Is there an alternative to FILTER method in a two-column search key in ADO?

    Please help!


  2. #2
    george Guest

    Re: SEEK vs FIND vs FILTER


    If you're using an Oracle database, you might want to try OO4O, which is Oracle's
    in-process server
    for conecting to Oracle databases. It is shipped with Oracle client-side
    products, and has a pretty
    intuitive object model.


    "Dante" <dantedt@yahoo.com> wrote:
    >
    >I am using VB 6 SP3, OLEDB / ADO 2.1, and Oracle Database.
    >
    >I have a Client-side ADODB recordset and the recordset is displayed
    >on a DataGrid.
    >
    >I want to search for a record in the recordset (and highlight the record
    >found on the Grid), using TWO columns as search key.
    >
    >1) I tried using rs.Index and rs.Seek, but I got the message that the
    > Provider does not support the Index method.
    > (I think Index and Seek work only with Server-side recordsets;
    > but a Server-side rs can't display records on a DataGrid)
    >
    >2) Find method is limited only to one search column
    >
    >3) So I used the Filter method :
    >
    > varBkMrk = rs.Bookmark
    > rs.Filter = "COL1 ='" & strVar1 & "' and COL2 ='" & strVar2 & "'"
    > if not rs.EOF then
    > msgbox "Found"
    > varBkMrk = rs.Bookmark
    > else
    > msgbox "not found"
    > endif
    >
    > rs.Filter = ""
    > rs.Bookmark = varBkMrk
    >
    > I have two problems with the Filter method :
    >
    > (a) the above code causes the Grid to "blink", because the filter

    will
    >cause a
    > single record display in the Grid, clearing the filter will display
    >all but will move
    > the pointer to the first record, and then rs.Bookmark=varBkMrk
    >highlights the
    > found record.
    >
    > (b) I am not sure if Filter is an efficient way of searching, especially
    >if the
    > recordset is large
    >
    >Is there an alternative to FILTER method in a two-column search key in ADO?
    >
    >Please help!
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center