Hi, I am having trouble with this error message - have used
similar code before without any problems (I'm pretty new to
coldfusion)
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 2.
The error occurred in C:\Program Files (x86)\Apache Software
Foundation\Apache2.2\htdocs\CFIDE\collinsvillerealestate\buypropertyresults.cfm:
line 36
34 : <!---search by price range --->
35 : <cfif FORM.price IS NOT "">
36 : AND [price] <= #FORM.price#
37 : </cfif>
38 :
--------------------------------------------------------------------------------
SQLSTATE 07002
SQL SELECT shortDescription, propertyID, price,
numberOfBedrooms, numberOfBathrooms, numberOfCarports, locationID,
imageNameOne, categoryID, longDescritpionOne FROM propertiesForSale
WHERE 0=0 AND locationID = 1 AND categoryID = 1 AND
numberOfBedrooms = 2 AND [price] <= 300000 ORDER BY propertyID
VENDORERRORCODE -3010
DATASOURCE collinsvillerealestate
___________________________________________
My code is:
<cfquery datasource="collinsvillerealestate"
name="properties">
SELECT shortDescription, propertyID, price, numberOfBedrooms,
numberOfBathrooms, numberOfCarports, locationID,
imageNameOne,
categoryID, longDescritpionOne
FROM propertiesForSale
WHERE 0=0
<!---search by location --->
<cfif FORM.locationID IS NOT "">
AND locationID = #FORM.locationID#
</cfif>
<!---search by category--->
<cfif FORM.categoryID IS NOT "">
AND categoryID = #FORM.categoryID#
</cfif>
<!---search by number of bedrooms --->
<cfif FORM.numberOfBedrooms IS NOT "">
AND numberOfBedrooms = #FORM.numberOfBedrooms#
</cfif>
<!---search by price range --->
<cfif FORM.price IS NOT "">
AND price <= #FORM.price#
</cfif>
ORDER BY propertyID
</cfquery>
Have tried removing and fiddling with statement, but error
message applies to all parts of the statement.
Thanks