thunderain
Programmer
1/Coldfusion Studio 4.5a, Microsoft Access 2000 database
2/ I am trying two input two numbers from a form on previous page, get all files in a table that match either number.
3/ I get this error:
Error Diagnostic Information
ODBC Error Code = 07001 (Wrong number of parameters)
[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.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (9:1) to (9:59).
My Code: Tried it two ways:
First Way:
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site
FROM filtran
WHERE (0=0
<cfloop list="#form.Filtran_Part_Number#" index="ThisNumber" delimiters=",">
AND (AMD_Part_Number LIKE "%#ThisNumber#%"
</cfloop>)
Second Way:
ListGetAt(form.Filtran_Part_Number, 1,","
ListGetAt(form.Filtran_Part_Number, 2)
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site
FROM filtran
WHERE (
0=0
<cfloop list="#form.Filtran_Part_Number#" index="ThisNumber">
and (AMD_Part_Number LIKE "%#ThisNumber#%"
</cfloop>)
=======
As the error indicates, my field name in the database table is doesn't match my code. This is incorrect as they do match. Something else is causing it.
Any ideas?
Thank you
2/ I am trying two input two numbers from a form on previous page, get all files in a table that match either number.
3/ I get this error:
Error Diagnostic Information
ODBC Error Code = 07001 (Wrong number of parameters)
[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.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (9:1) to (9:59).
My Code: Tried it two ways:
First Way:
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site
FROM filtran
WHERE (0=0
<cfloop list="#form.Filtran_Part_Number#" index="ThisNumber" delimiters=",">
AND (AMD_Part_Number LIKE "%#ThisNumber#%"
</cfloop>)
Second Way:
ListGetAt(form.Filtran_Part_Number, 1,","
ListGetAt(form.Filtran_Part_Number, 2)
<cfquery name="filtran" datasource="filtran" dbtype="ODBC">
SELECT Filtran_Part_Number, Description, On_Web_Site
FROM filtran
WHERE (
0=0
<cfloop list="#form.Filtran_Part_Number#" index="ThisNumber">
and (AMD_Part_Number LIKE "%#ThisNumber#%"
</cfloop>)
=======
As the error indicates, my field name in the database table is doesn't match my code. This is incorrect as they do match. Something else is causing it.
Any ideas?
Thank you