Just as note (I saw you solved it): this is an ODBC error, not a CF
Error.  If you were to run the same (bad) query through a generic ODBC
connection (like MSQuery) you would have gotten the same error.

When testing queries it's always best try and test via the same
connection type that you'll be using in real life.  You'll save yourself
a lot of frustration in the end.  ;^)

Jim Davis

> -----Original Message-----
> From: pat forbes [mailto:[EMAIL PROTECTED]
> Sent: Sunday, September 14, 2003 11:30 PM
> To: CF-Talk
> Subject: works fine in access, but not cf
> 
> I might have posted this twice... sorry... but after I posted the
first
> time, I got an email that said I wasn't subscribed (even though I was
at
> CFTalk when I posted), and I didn't see the first post so, here it
goes
> again.
> 
> 
> Can someone tell me why the following works fine in msaccess, but
returns
> an error in CF 4.51, sp2
> 
> SELECT accounts.accountid, accounts.streetname
> FROM accounts
> WHERE accounts.streetname In ("ANCIENT FOREST DRIVE","APPLE HOLLOW
COURT")
> 
> The cf error is:
> 
> ------------
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
2.
> 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.
> SQL = "SELECT accounts.accountid, accounts.streetname FROM accounts
WHERE
> accounts.streetname In ("ANCIENT FOREST DRIVE","APPLE HOLLOW COURT")"
> -------------
> 
> Actually, I am wanting to pass a whole slew of "street names" and
replace
> the hard coded ones above with a variable name.  I can pass the
variable
> name (selected_streets), and all streets are conformed to be in that
list
> but, I still cannot get the query right.
> 
> I guess I could build the query with a ton of "OR's" based on what is
in
> the list but the IN seems to be a easier to code.
> 
> ie:
> SELECT accounts.accountid, accounts.streetname
> FROM accounts
> WHERE (0=0)
> AND accounts.streetname = "ANCIENT FOREST DRIVE"
> OR accounts.streetname ="APPLE HOLLOW COURT"
> OR accounts.streetname ="xxxxx etc"
> OR....
> 
> Any help is appreciated.
> 
> -pat-
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to