Solved

Too few parametersin RS

Posted on 2007-11-26
4
289 Views
Last Modified: 2010-04-25
Hi

I have spenat ages putting together this query string in Access. Now I have it in the Recordset window in Dreamweaver I keep getting the good old:

Too few parameters expected one - response. I've tried various ways of rearranging it, taking out some of accesses brackets that I have done before. But can't solve this one.

Any Ideas please?

Thanks
<%

Dim RsProdsGen__ParamAgeFrom

RsProdsGen__ParamAgeFrom = "1"

If (Request.Form("frmagefrm") <> "") Then 

  RsProdsGen__ParamAgeFrom = Request.Form("frmagefrm")

End If

%>

<%

Dim RsProdsGen__ParamAgeTo

RsProdsGen__ParamAgeTo = "100"

If (Request.Form("frmageto") <> "") Then 

  RsProdsGen__ParamAgeTo = Request.Form("frmageto")

End If

%>

<%

Dim RsProdsGen__ParamGen

RsProdsGen__ParamGen = "b"

If (Request.Form("frmgen") <> "") Then 

  RsProdsGen__ParamGen = Request.Form("frmgen")

End If

%>

<%

Dim RsProdsGen__ParamPriceFrom

RsProdsGen__ParamPriceFrom = "10"

If (Request.Form("frmpricefrm")  <> "") Then 

  RsProdsGen__ParamPriceFrom = Request.Form("frmpricefrm") 

End If

%>

<%

Dim RsProdsGen__ParamPriceTo

RsProdsGen__ParamPriceTo = "30"

If (Request.Form("frmpriceto")   <> "") Then 

  RsProdsGen__ParamPriceTo = Request.Form("frmpriceto")  

End If

%>

<%

Dim RsProdsGen

Dim RsProdsGen_cmd

Dim RsProdsGen_numRows
 

Set RsProdsGen_cmd = Server.CreateObject ("ADODB.Command")

RsProdsGen_cmd.ActiveConnection = MM_MagicalRooms_STRING

RsProdsGen_cmd.CommandText = "SELECT tblProducts.ProdID, tblProducts.ProdName, Min(tblPrice.Price) AS MinOfPrice, Min(tblPrice.Price) AS MinOfPrice1, Count(tblPrice.Price) AS CountOfPrice, tblImages.Image FROM (tblProducts LEFT JOIN tblImages ON tblProducts.ProdID = tblImages.ProdID) LEFT JOIN tblPrice ON tblProducts.ProdID = tblPrice.PriceProdID WHERE tblProducts.ProdAgeFrom <= ? AND tblProducts.ProdAgeTo<= ? AND tblProducts.ProdGender =  ? Or tblProducts.ProdGender ="u" AND tblImages.Featured=True GROUP BY tblProducts.ProdID, tblProducts.ProdName, tblImages.Image HAVING  (Min (tblPrice.Price)) >= ? AND (Min (tblPrice.Price))<= ?" 

RsProdsGen_cmd.Prepared = true

RsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param1", 5, 1, -1, RsProdsGen__ParamAgeFrom) ' adDouble

RsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param2", 5, 1, -1, RsProdsGen__ParamAgeTo) ' adDouble

RsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param3", 200, 1, 255, RsProdsGen__ParamGen) ' adVarChar

RsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param4", 5, 1, -1, RsProdsGen__ParamPriceFrom) ' adDouble

RsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param5", 5, 1, -1, RsProdsGen__ParamPriceTo) ' adDouble
 

Set RsProdsGen = RsProdsGen_cmd.Execute

RsProdsGen_numRows = 0

%>

Open in new window

0
Comment
Question by:swordfishsoup
4 Comments
 
LVL 15

Expert Comment

by:cquinn
ID: 20350822
This error is more often than not caused by a misspelling of a field or table name
0
 

Accepted Solution

by:
swordfishsoup earned 0 total points
ID: 20350897
No it was th "u" change this to ParamUni and set the value to u and works fine.

Thanks anyway - must be a dreamweaver quirk
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20560027
Closed, 500 points refunded.
Computer101
EE Admin
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now