like / contains query

Discussion in 'ASP General' started by David, Jan 27, 2004.

  1. David

    David Guest

    Hi,

    I am trying to put a very basic search function on a web page. I'm using
    access 2000 as the database, and have a memo field I want to search using a
    keyword entered via a form.

    The problem I'm having is I can't work out the correct syntax for the query.
    What I'm trying is the "like" command, and am trying to work the query
    below. articletext is a memo field, and querystring is passed from the form
    on the search page. What syntax should I use please?

    set rsData = con.execute("select topic, title, ID, description, dateno,
    linktooriginal, summaryavail from journals where articletext LIKE =
    '%"&searchstring&"%' ORDER BY dateno DESC")

    Also, are there any tutorials on making a search engine to search memo
    fields? Maybe an already made one?

    Thanks

    David
     
    David, Jan 27, 2004
    #1
    1. Advertising

  2. David

    Alex Goodey Guest

    remove the = after LIKE

    "David" <> wrote in message
    news:CLsRb.97$...
    > Hi,
    >
    > I am trying to put a very basic search function on a web page. I'm using
    > access 2000 as the database, and have a memo field I want to search using

    a
    > keyword entered via a form.
    >
    > The problem I'm having is I can't work out the correct syntax for the

    query.
    > What I'm trying is the "like" command, and am trying to work the query
    > below. articletext is a memo field, and querystring is passed from the

    form
    > on the search page. What syntax should I use please?
    >
    > set rsData = con.execute("select topic, title, ID, description, dateno,
    > linktooriginal, summaryavail from journals where articletext LIKE =
    > '%"&searchstring&"%' ORDER BY dateno DESC")
    >
    > Also, are there any tutorials on making a search engine to search memo
    > fields? Maybe an already made one?
    >
    > Thanks
    >
    > David
    >
    >
     
    Alex Goodey, Jan 27, 2004
    #2
    1. Advertising

  3. David

    David Guest

    The specific error I get is:-

    Microsoft JET Database Engine error '80040e14'

    Syntax error (missing operator) in query expression 'articletext LIKE =
    '%medical%''.

    /journal/searchdisplay.asp, line 83

    I know for a fact there are many entries in the articletext memo field that
    contain the keyword "medical"

    Thanks
     
    David, Jan 27, 2004
    #3
  4. David

    David Guest

    Thanks Alex!
     
    David, Jan 27, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Dyer
    Replies:
    5
    Views:
    676
  2. Patrick Kowalzick
    Replies:
    5
    Views:
    496
    Patrick Kowalzick
    Mar 14, 2006
  3. Replies:
    9
    Views:
    318
    M.-A. Lemburg
    Jun 4, 2008
  4. David

    "query contains" help please

    David, Jan 20, 2004, in forum: ASP General
    Replies:
    3
    Views:
    115
    David
    Jan 20, 2004
  5. Roland Hall

    ASP LIKE query using parameterized query

    Roland Hall, Jan 12, 2007, in forum: ASP General
    Replies:
    8
    Views:
    230
    Roland Hall
    Jan 13, 2007
Loading...

Share This Page