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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stumped on a query 1

Status
Not open for further replies.

twcman

Programmer
Joined
Jun 28, 2001
Messages
284
Location
US
I am stumped on a query error. the first query runs fine in the code. the second one generates the error shown below the code... any one have an idea why?

<cfquery name=&quot;findresponseto&quot; datasource=&quot;#datasource#&quot; dbtype=&quot;ODBC&quot;>
SELECT responseto
FROM tlkpresponseto
WHERE responsetoid = #responsetoid#
</cfquery>
#findresponseto.responseto#
</td>
<td><cfquery name=&quot;findeventname&quot; datasource=&quot;#datasource#&quot; dbtype=&quot;ODBC&quot;>
SELECT eventnm
FROM tlkpeventnm
WHERE eventnmid = #eventnmid#
</cfquery>


=============================

Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'eventnmid ='.


SQL = &quot;SELECT eventnm FROM tlkpeventnm WHERE eventnmid =&quot;

Data Source = &quot;JUSTICEGATE&quot;


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (900:9) to (900:78) in the template file C:\Inetpub\

Date/Time: 10/29/01 09:18:53
Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)
Remote Address: 192.168.0.3
Query String: formname=donation&mainid=13306
 
What is the value of #eventnmid# when the query fails? Once you determine that, type the query into your database's SQL interface and try the query directly against the database. You should get a more detailed error message.
 
thanks for the input. Jhoarty hit the nail on the head. the variable was null so there was nothing to compare to for the = part of the where statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top