usually this error indicates you've mispelled a column name in your query.
if it works sometimes and not others, this would be because of one of the
columns in the If clauses.  check your spelling of column names against the
actual table.




                                                                                       
                            
                    James                                                              
                            
                    Buckingham           To:     "'[EMAIL PROTECTED]'" <[EMAIL 
PROTECTED]>     
                    <[EMAIL PROTECTED]        cc:                                      
                                 
                    a.com>               Subject:     [ cf-dev ] [Microsoft][ODBC 
Microsoft Access Driver] Too few 
                                         parameters. Exp ected 1. error on CF 5.0      
                            
                    12/05/2004                                                         
                            
                    14:41                                                              
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



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








-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to