Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Shoud this question be here or somewhere else? (subquery)

    Hi! I have a database (MS Access) that I access from an ASP-page. The page contains results from a query based on a session variable set by the login page. In this case, the session variable contains the string "luxury". The query selects all records where the field 'fulltext' contains the string "luxury" and presents them to me on this page. So far no problems.

    I have - however - a form on this same page, where I want people to be able to search within the already selected records. I've tried to do a statement like:

    SELECT * FROM table1 WHERE fulltext LIKE '%txt%' IN (SELECT cat,magazine,fulltext
    FROM table1
    WHERE cat LIKE '1' AND magazine LIKE '%md%' AND (fulltext LIKE '%wds%'))

    In this example, variables 'txt' and 'md' come from the form on the page, whereas 'wds' is the string that I set up as a session variable.

    When testing this statement, I get this error:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Invalid Memo, OLE, or Hyperlink Object in subquery 'textofull ALike '%%%''.

    /apoyos2.asp, line 54

    Am I barking up the wrong tree here? Any help would be appreciated!

    P.S. Am using Dreamweaver MX 2004

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    This might give you some clues. Seems like you'd put parentheses around one chuck of a WHERE clause and the word AND and then parentheses around another chunk of the WHERE clause...

    ASP Design Tips - Search For an Expression on Multiple Fields
    http://www.bullschmidt.com/devtip-se...iplefields.asp
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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