non so se riuscirete a capirmi :master:
ho un database con una serie di prodotti che hanno categorie (processori memorie dvd) e produttori fissi (intel amd hp epson)
nell'appicazione che sto realizzando interrogo il database per estrarre i campi in base al produttore e alla categoria ed ottengo un elenco
ordino già l'elenco in base a categorie e produttori ma vorrei far evidenziare quando cambiano
interrogando il database per estrarre la categoria cpu vorrei ottenere
amd
amd sempron 1000
amd sempron 2000
amd am2 3000
pentium
pentium celeron 1500
pentium celeron 2000
pentium p3
pentium p4
questo è il codice che uso
<%
dim categoria
categoria=request.form("categoria")
Response.Write "
Prodotti trovati nella cateogira "
Response.Write categoria
Response.Write "
"
dbfile=Server.MapPath("mdb-database/prodotti.mdb")
Set OBJdbConnection=Server.CreateObject("ADODB.Connect ion")
OBJdbConnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbfile
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM prodotti WHERE categoria='" & categoria & "' order by categoria"
rs.Open sql, OBJdbConnection, 3, 3
if rs.EOF then
Response.Write "nessun prodotto trovato"
else
While Not rs.EOF
Response.Write Rs("produttore")
Response.Write("
<a href='prodotto.asp?id=" & rs.fields("id") & "' target=''>" & _
nome & "</a>
" )
rs.movenext
Wend
rs.Close
set rs = Nothing
response.write strOutput
response.end
end if
%>
e ottengo semplicemente
amd sempron 1000
amd sempron 2000
amd am2 3000
pentium celeron 1500
pentium celeron 2000
pentium p3
pentium p4
come faccio?

Rispondi quotando
