Don’t know if you’ve got an
answer to this one yet, but is it possible that one of the field values has a
single quote in it? Company= ‘Smith’s Widgets’ for example.
That would cause problems. From:
James Buckingham [mailto:[EMAIL PROTECTED] Afternoon guys, I've been puzzling away at this one all morning but no
matter how I look at it I can't seem to nail what's causing the following error
message: Error
Diagnostic Information
ODBC
Error Code = 07001 (Wrong number of parameters) [Microsoft][ODBC
Microsoft Access Driver] Too few parameters. Expected 1. Hint: The cause of this error is usually
that your query contains a reference to a field which does not exist. You should
verify that the fields included in your query exist and that you have specified
their names correctly. The error occurred while processing an element with a
general identifier of (CFQUERY), occupying document position (2:1) to (2:47). The system is a basic form, with the following fields: WTNADD1__Location WTNADD1__LastName WTNADD1__internet WTNADD1__Company WTNADD1__Keyword These are sent to another CF file which does the following
query: <CFQUERY NAME="GetResults"
DATASOURCE="#application.datasource#"> SELECT
Company,Location,FirstName,LastName,DataNo FROM WTNADD1 WHERE contactlist = 'y' <CFIF #WTNADD1__Keyword# IS NOT
"" AND #WTNADD1__Keyword# IS NOT "Any Keyword"> AND SpecialInterestKeywords LIKE
'%#WTNADD1__Keyword#%' </CFIF> <CFIF #WTNADD1__LastName# IS NOT
""> AND LastName LIKE
'%#WTNADD1__LastName#%' </CFIF> <CFIF #WTNADD1__Location# IS NOT
"All Locations" AND #WTNADD1__Location# IS NOT ""> AND WLocation =
'#WTNADD1__Location#' </CFIF> <CFIF #WTNADD1__internet# IS NOT
"" AND #WTNADD1__internet# IS NOT "@"> AND internet LIKE
'%#WTNADD1__internet#%' </CFIF> <CFIF #WTNADD1__Company# IS NOT
"Any Company"> AND CompanyName = '#WTNADD1__Company#'
</CFIF> ORDER BY LastName </CFQUERY> I think its Access rather than Cold Fusion that's causing
the problem but I'm not 100% sure. Access seems to like the query when I run
the SQL within it. One thing I would say though is that the results don't
always return a record. That wouldn't give that error message though, would it?
Just so you know I'm running CF5.0 Cheers in advance, JamesB |
- [ cf-dev ] [Microsoft][ODBC Microsoft Access Driver] Too ... James Buckingham
- RE: [ cf-dev ] [Microsoft][ODBC Microsoft Access Dri... Snake Hollywood
- Robin Griffiths