Ciao a tutti, vorrei sapere se è possibile in asp creare un elenco così:
#-A-B-C...ecc
Dove il simbolo # porta a tutti gli articoli con titolo che comincia per numero tipo 300 (il film)
Io per le sole lettere uso questo codice:
&lettera=A">A
&lettera=B">B
&lettera=C">C...ecc.
<%
Set RSa = Server.CreateObject("ADODB.Recordset")
RSa.ActiveConnection = con
sqlString = "select id from console where lcase(nome) = '" & lcase(idx) & "'"
RSa.open sqlString
idr = rsa("id")
ok = -1
Set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = con
Dim lettera
lettera = Server.HTMLEncode(Request.QueryString("lettera"))
sqlString = "SELECT * from articoli WHERE attivo = " & ok & " AND console = " & idr
If Len(Trim(lettera)) = 1 Then
sqlString = sqlString & " AND titolo LIKE '" & lettera & "%' order by articoli.titolo"
End If
RS.open sqlString, con, 1
while not rs.eof
foto = rs("foto11")
if foto = "" or isnull(foto) then
foto = "vuota.jpg"
end if
%>
:master:

Rispondi quotando
