Can anyone tell me why the following query:
<cfquery name="search" datasource="myDatabase" dbtype="ODBC">
SELECT strProdID, strProdName, strProdCatagory, curPrice, strPublisher, strAuthor, memDescription, hypSmallPic, numWeight
FROM Ccdatabase
WHERE strProdName LIKE "*#searchtext#*"
</cfquery>
gives the following error (ive posted this in the access forum and it was suggested i come here because it may be related to ColdFusion):
ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.
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.
I checked that all of the fields exist in the table. I deleted all but one of the select fields (strProdId) and the only change to the error message was "Expected 1" instead of "Expected 4"? And when i put single quotes around the *#searchtext#* it says "Expected 3". Does this make sense? (also, putting single or double quotes inside the wildcard asterisk causes "missing operator" error).
<cfquery name="search" datasource="myDatabase" dbtype="ODBC">
SELECT strProdID, strProdName, strProdCatagory, curPrice, strPublisher, strAuthor, memDescription, hypSmallPic, numWeight
FROM Ccdatabase
WHERE strProdName LIKE "*#searchtext#*"
</cfquery>
gives the following error (ive posted this in the access forum and it was suggested i come here because it may be related to ColdFusion):
ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.
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.
I checked that all of the fields exist in the table. I deleted all but one of the select fields (strProdId) and the only change to the error message was "Expected 1" instead of "Expected 4"? And when i put single quotes around the *#searchtext#* it says "Expected 3". Does this make sense? (also, putting single or double quotes inside the wildcard asterisk causes "missing operator" error).