I didn't realise you had to construct SQL statements differently between the two versions!?
 

_______________________________________________________

 Regards,
                Richard Lovelock,
                Senior Application Analyst.

Westminster City Council - Web Support
Capgemini UK
Southbank
95 Wandsworth Road
London
SW8 2HG

(     0870 906 7482
 
_______________________________________________________

-----Original Message-----
From: James Buckingham [mailto:[EMAIL PROTECTED]
Sent: 13 May 2004 11:01
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. error on CF 5.0

Morning guys,

 

Yeah I think I found out what the problem. One thing I forgot to mention, for the reason I thought it would be irrelevant, was that the Access DB's are in Access '97. The moment I converted them to 2000 they started working. It seemed to be the syntax of the LIKE statements that it didn't like.

 

What a pain but there you go J

 

Cheers,

James

 


From: Robin Griffiths [mailto:[EMAIL PROTECTED]
Sent: 13 May 2004 09:16
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. error on CF 5.0

 

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]
Sent: 12 May 2004 14:42
To: '[EMAIL PROTECTED]'
Subject: [ cf-dev ] [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. error on CF 5.0

 

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


Our name has changed. Please update your address book to the following format: "[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Reply via email to