CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Searching a Memo Field

    I have this small dataBase that contains a Memo Field.
    I need to be able to search this memo field for particular words.
    Being a DataBase ignorant soul. I am at a loss.
    Can anyone help?
    Here is an example of a SQL statement the program currently uses

    set mRS = mDB.OpenRecordset("select * from codeitems where id = " & msKey)
    '
    '
    I need it something like
    set mRS = mDB.OpenRecordset("select * from codeitems where example contains the word "Bookmark").



    My DataBAse for Dummies book does not cover this situation.


    John G

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Searching a Memo Field

    If your database for dummies book does not cover that part, throw it away.

    set mRS = mDB.OpenRecordset("select * from codeitems where example like ""*Bookmark*""")




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: adding to Cakkie

    Depending on database/provider you may have to write
    "...like ''%Bookmark%'' "

    Do not throw away your books. Buy some more ones!
    (The BookSeller)

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Searching a Memo Field

    Actually my book does cover the "Like" verb. I was hoping for something a little more sophisticated though. My memo field data could include 30-40Kb per record so searching using "Like" may take a while.
    I never throw out books. At the very least I donate them to a library.

    '
    Thanks guys,

    John G

  5. #5
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Searching a Memo Field

    Ok, LIKE can be slow, but I don't think there actually is a fast way of doing something like this. I don't thing processing the entire recordset will be any faster, hence you still need to write it yourself.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured