Hi
I have an asp vb site created in DW8 wih an access database, for an online store.
I need some guidence as to the following issue....
I am making a list page with a thumbnail of the products - product name and price, using a repating horizontal region- and a 'more' button for further info (detail page).
My cunundrum(other than being able to spell conundrum??) is:
Some products have different sizes and colours and prices (depending on size) . The recordset I have brings up all the entries - so for 'Wizard teddy bear' I just want one item on the list page but as it has three prices - for smal medium and large - my recordset is giving me three results - hence I have teddies galore!
Does that make any sense? There isn't an error message as such I just need to be pointed in the right direction to say something in asp vb for: (english translation)....
# Select all records from the database where category is bla bla and age group is bla and gender is (boys and girls toys) - but just give me the name and details once and the lowest price so I can add a 'From' £6.99 If there are multiple prices. or the price if there is only one.
Be great to have pointer in the right direction for this. Please let me know I f I need to post any of the specific code for this. The current select statement is:
<%
Dim RsProdsGen
Dim RsProdsGen_cmd
Dim RsProdsGen_numRows
Set RsProdsGen_cmd = Server.CreateObject ("ADODB.Command")
RsProdsGen_cmd.ActiveConne
ction = MM_MagicalRooms_STRING
RsProdsGen_cmd.CommandText
= "SELECT tblProducts.*, tblPrice.*, tblImages.Image, tblProdCat.*, tblSubCat.* FROM (tblTheme RIGHT JOIN (tblSTheme RIGHT JOIN (tblSizeGroup RIGHT JOIN (tblSubCat RIGHT JOIN (tblProdCat RIGHT JOIN (((tblProducts LEFT JOIN tblImages ON tblProducts.ProdID = tblImages.ProdID) LEFT JOIN tblPrice ON tblProducts.ProdID = tblPrice.PriceProdID) LEFT JOIN tblCatList ON tblProducts.ProdID = tblCatList.CatListProdID) ON tblProdCat.CatID = tblCatList.CatListCatID) ON tblSubCat.SubID = tblCatList.CatListSubCatID
) ON tblSizeGroup.SizeGroupID = tblPrice.PriceSizeID) ON tblSTheme.SThemeID = tblProducts.ProdSThemeID) ON tblTheme.ThemeID = tblProducts.ProdThemeID) LEFT JOIN (tblAvailColours RIGHT JOIN tblProdColours ON tblAvailColours.AvailColou
rID = tblProdColours.ProdAvailCo
lour) ON tblProducts.ProdID = tblProdColours.ProdProdID WHERE CatListCatID = ? AND tblImages.ProdID = tblProducts.ProdID AND Featured = True AND ProdGender = ? AND ProdAgeFrom >= ? AND ProdAgeTo <= ? ORDER BY tblProducts.ProdID"
RsProdsGen_cmd.Prepared = true
RsProdsGen_cmd.Parameters.
Append RsProdsGen_cmd.CreateParam
eter("para
m1", 5, 1, -1, RsProdsGen__MMColParam) ' adDouble
RsProdsGen_cmd.Parameters.
Append RsProdsGen_cmd.CreateParam
eter("para
m2", 200, 1, 255, RsProdsGen__MMColParam3) ' adVarChar
RsProdsGen_cmd.Parameters.
Append RsProdsGen_cmd.CreateParam
eter("para
m3", 5, 1, -1, RsProdsGen__MMColParam4) ' adDouble
RsProdsGen_cmd.Parameters.
Append RsProdsGen_cmd.CreateParam
eter("para
m4", 5, 1, -1, RsProdsGen__MMColParam5) ' adDouble
Set RsProdsGen = RsProdsGen_cmd.Execute
RsProdsGen_numRows = 0
%>
Thanks
Dave