Help with error message: Too Few Parameters. Expected 1.

  • Thread starter Thread starter malhyp
  • Start date Start date
M

malhyp

Hi, can anyone see where i have gone wrong in this SQL. I continue to get the
error message below.

SELECT SupplierName, Location, ShortDescription
FROM Query1
WHERE TimberSpecies LIKE '%MMColParam%' AND CategoryTable LIKE '%MMColParam2%
' AND Location LIKE '%MMColParam3%'

MMColParam 1 Request.Form("keywordSearch")
MMColParam 2 Request.Form("CategoryTable")
MMColParam 3 Request.Form("Location")

When I test this SQL in the recordset i get the following error message.

[Microsoft][ODBC Microsoft Access Driver] Too Few Parameters. Expected 1.

??

Mally.
 
For one thing, your parameters are

MMColParam, MMColParam1 and MMColParam2, and below you use MMColParam 1,
MMColParam 2, and MMColParam 3. See the difference?

You should post the entire code you're using. Also, normal (Jet) syntax is
to use '*' instead of '%', which tells me you're using a connection that's
forcing you to use more "standard" SQL. If you use a connection more like

"Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(dbName) &
";"

then you should be able to use Access's native syntax in your stored query,
allowing you to test in the database itself.

Next, the MM prefix tells me you're probably using Dreamweaver, which costs
you several seconds every time you call the database. Learning to hand code
will result in significant performance improvements.

Finally, this particular forum is about coding Access's internal forms. You
might get a wider range of more informed eyes peering at it if you went to
microsoft.public.access.internet or even macromedia.dreamweaver.

HTH;

Amy Blankenship
Team Macromedia, Authorware
 
Back
Top