I have a page that i'm trying to create in asp with a list of 10 different products. I also have a database that the page is connecting to. It lists the names of all of my products (more than 10) with pricing. I'm trying to display the prices that i need for each of these products in the selected spot on this page. The only problem is i am unsure about how to set this up. I have been able to display the whole table, and 1 value, but I can't figure out how to go about displaying these selected values that i need. Here's the connection i used to display one of the selected prices on another page: (with the price display being <%=rs("Price1")%>
========================================
<%
' Name of the Accessdb being read
accessdb="database/pricelist2.mdb"
' Connect to the db with a DSN-less connection
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
' Create a server recordset object
Set rs = Server.CreateObject("ADODB.Recordset")
' Select specific fields from the table the_bird
sql = "SELECT Price1 FROM gold_prices WHERE ID=4;"
' Execute the sql
rs.Open sql, cn
%>
Can someone tell me how to go about this if i need to pick 10 various prices from my table, where the sql would be comparable to this above? Thanks!!!
========================================
<%
' Name of the Accessdb being read
accessdb="database/pricelist2.mdb"
' Connect to the db with a DSN-less connection
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
' Create a server recordset object
Set rs = Server.CreateObject("ADODB.Recordset")
' Select specific fields from the table the_bird
sql = "SELECT Price1 FROM gold_prices WHERE ID=4;"
' Execute the sql
rs.Open sql, cn
%>
Can someone tell me how to go about this if i need to pick 10 various prices from my table, where the sql would be comparable to this above? Thanks!!!