Ask a Question related to Coldfusion Database Access, Design and Development.
-
raulriera #1
Error making a search system
Hi all, this is a simple search system to lookup proyects that contains the
words in the querystring "palabras", but when running the code I get this error
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'FIRST WORD
HERE'. <---thats an example heh
The code is this one, the error ocurrs even if I use single quotes on the
words
<cfset palabrasClaves = #URL.palabras#>
<cfset lineaSQL = "">
<cfloop index="palabraBusqueda" list="#palabrasClaves#" delimiters = " :/">
<cfset lineaSQL = lineaSQL & "titulo LIKE " & "'%" & palabraBusqueda & "%'"
& " OR ">
</cfloop>
<!--- Borrar los ultimos 3 caracteres del string lineaSQL --->
<cfset lineaSQL = RemoveChars(lineaSQL,Len(lineaSQL) - 3,4)>
<!--- Hacer el query --->
<cfquery name="busquedaPropuestas" datasource="DNS">
SELECT * FROM ListadoPropuestas WHERE #lineaSQL#
</cfquery>
raulriera Guest
-
Help with making a Search field
I would realy appreciate some help. I need to create a search field in my web site and dont know how to create it and link it to seach the site.... -
System.Net.WebException making web service calls about 10% of the time.
We are seeing a very frustrating intermittent problem. We are making Synchronious web service method calls from a .NET windows Service using the... -
In search of a link making plug-in/utility
Have a rather large .pdf document, a software manual to be precise, where hot page links or cross-references are a requirement… a 1,000 or more of... -
Making Filemaker search smarter
I have a large database of "Projects", with an even larger related database of "Actions". In Projects, I have a computed field Action Count =... -
How can a process consume kernel CPU time without making system calls?
I'm trying to track down what is going on with a particular rogue application process on a customer site running AIX 4.3.3. Under defined... -
jdeline #2
Re: Error making a search system
You need to use PreserveSingleQuotes in the WHERE clause. See code below.
<cfquery name="busquedaPropuestas" datasource="DSN">
SELECT * FROM ListadoPropuestas WHERE #PreserveSingleQuotes(lineaSQL)#
</cfquery>
jdeline Guest
-
raulriera #3
Re: Error making a search system
thanks that worked like a charm... you are the man
raulriera Guest



Reply With Quote

