%
Option Explicit
Dim sql,rsUsers,username,startletter,alphabet,newcount
startletter = Request.QueryString("startletter")
if startletter = "" then
startletter = "A"
end if
%>
<%
if startletter = "nonalphabet" then
sql = "SELECT username, icon FROM users WHERE username Not Like 'a%'"
for alphabet = 98 to 122
sql = sql & " AND username Not Like '" & chr(alphabet) & "%'"
next
sql = sql & " ORDER BY username"
else
sql = "SELECT username, icon FROM users WHERE username Like '" & startletter & "%' ORDER BY username"
end if
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open sql, conn, 3, 3
%>