If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Shoud this question be here or somewhere else? (subquery)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-04, 15:34
peoplayer peoplayer is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 03-10-04, 19:23
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On