Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL "Where Clause with Like" passed from ColdFusion to Access

Status
Not open for further replies.

anniemorin

Programmer
Feb 13, 2001
2
CA
Hi,
I'm programming a search engine. I'm using like sentences to find something near. for example this is my query:
Code:
<cfset q = &quot;SELECT Subject.subj_id, Subject.subj_name, Source.source_id,Source.source_title FROM Subject Left Join Source on source.subj_id = Subject.subj_id WHERE subj_name like '%foliations%'&quot;>
In ansi SQL we use the % and in Access it is *.

I tried my query in Access with the * and it worked fine
but when ColdFusion is sending the query with the % it doesn't work ... may be the problem is somewhere else and I can't figure what it is.

here is my error message (in case it could help)
------------------------------------------------
[tt]
ODBC Error Code = 37000 (Syntax error or access violation)

[Microsoft][Pilote ODBC Microsoft Access 97] Erreur de syntaxe dans l'expression 'subj_name alike ''%foliations%'''.

The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (6:1) to (6:62).
[/tt]
If anyone can help, it would be great.

Annie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top