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__ParamAgeFromRsProdsGen__ParamAgeFrom = "1"If (Request.Form("frmagefrm") <> "") Then RsProdsGen__ParamAgeFrom = Request.Form("frmagefrm")End If%><%Dim RsProdsGen__ParamAgeToRsProdsGen__ParamAgeTo = "100"If (Request.Form("frmageto") <> "") Then RsProdsGen__ParamAgeTo = Request.Form("frmageto")End If%><%Dim RsProdsGen__ParamGenRsProdsGen__ParamGen = "b"If (Request.Form("frmgen") <> "") Then RsProdsGen__ParamGen = Request.Form("frmgen")End If%><%Dim RsProdsGen__ParamPriceFromRsProdsGen__ParamPriceFrom = "10"If (Request.Form("frmpricefrm") <> "") Then RsProdsGen__ParamPriceFrom = Request.Form("frmpricefrm") End If%><%Dim RsProdsGen__ParamPriceToRsProdsGen__ParamPriceTo = "30"If (Request.Form("frmpriceto") <> "") Then RsProdsGen__ParamPriceTo = Request.Form("frmpriceto") End If%><%Dim RsProdsGenDim RsProdsGen_cmdDim RsProdsGen_numRowsSet RsProdsGen_cmd = Server.CreateObject ("ADODB.Command")RsProdsGen_cmd.ActiveConnection = MM_MagicalRooms_STRINGRsProdsGen_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 = trueRsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param1", 5, 1, -1, RsProdsGen__ParamAgeFrom) ' adDoubleRsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param2", 5, 1, -1, RsProdsGen__ParamAgeTo) ' adDoubleRsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param3", 200, 1, 255, RsProdsGen__ParamGen) ' adVarCharRsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param4", 5, 1, -1, RsProdsGen__ParamPriceFrom) ' adDoubleRsProdsGen_cmd.Parameters.Append RsProdsGen_cmd.CreateParameter("param5", 5, 1, -1, RsProdsGen__ParamPriceTo) ' adDoubleSet RsProdsGen = RsProdsGen_cmd.ExecuteRsProdsGen_numRows = 0%>
Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.