stevem2004
06-11-2004, 06:55 AM
Hi,
I have an Access DB, if I am using the code below, is it possible to split the list (as I have about 200 records) into an alphabetical list, ideally it would be nice if I have A - Z across the top, plus # for numbers, which the user can click on to take them to a page where only that letter of the alphabet will be displayed. E.g. click S and get everything beginning with S.
I hope I have explained myself clearly, does anyone know if this is even possible?
TIA
Steve
<%
dim conn, rs, strconn, strSQL
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("database")
set conn = server.createobject("adodb.connection")
conn.open strconn
strSQL = "SELECT * FROM table ORDER BY promocode ASC;"
set rs = server.createobject("adodb.recordset")
rs.open strSQL, conn, 3, 3
%>
<table border="1" width="620" bordercolor="#809CC9" cellpadding="1" cellspacing="0">
<tr>
<th class="smallbold"> ID </th>
<th class="smallbold">Promo Code</th>
<th class="smallbold">Status</th>
<th class="smallbold">Country</th>
<th class="smallbold">Sales From</th>
<th class="smallbold">Sales To</th>
<th class="smallbold">Travel From</th>
<th class="smallbold">Travel To</th>
<th class="smallbold">Created by</th>
</tr>
<% Do While Not rs.EOF %>
<tr>
<td class="small" align="center" valign="top"><a href=view.asp?id=<%=rs("id")%>><%=rs("id")%></a></td>
<td class="small" align="center" valign="top"><%=rs("promocode")%> </td>
<td class="small" align="center" valign="top"><%=rs("promostatus")%> </td>
<td class="small" align="center" valign="top"><%=rs("country")%> </td>
<td class="small" align="center" valign="top"><%=rs("salefrom")%> </td>
<td class="small" align="center" valign="top"><%=rs("saleto")%> </td>
<td class="small" align="center" valign="top"><%=rs("travelfrom")%> </td>
<td class="small" align="center" valign="top"><%=rs("travelto")%> </td>
<td class="small" align="center" valign="top"><%=rs("txtName")%> </td>
</tr>
<%
rs.MoveNext
Loop
%>
</table>
I have an Access DB, if I am using the code below, is it possible to split the list (as I have about 200 records) into an alphabetical list, ideally it would be nice if I have A - Z across the top, plus # for numbers, which the user can click on to take them to a page where only that letter of the alphabet will be displayed. E.g. click S and get everything beginning with S.
I hope I have explained myself clearly, does anyone know if this is even possible?
TIA
Steve
<%
dim conn, rs, strconn, strSQL
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("database")
set conn = server.createobject("adodb.connection")
conn.open strconn
strSQL = "SELECT * FROM table ORDER BY promocode ASC;"
set rs = server.createobject("adodb.recordset")
rs.open strSQL, conn, 3, 3
%>
<table border="1" width="620" bordercolor="#809CC9" cellpadding="1" cellspacing="0">
<tr>
<th class="smallbold"> ID </th>
<th class="smallbold">Promo Code</th>
<th class="smallbold">Status</th>
<th class="smallbold">Country</th>
<th class="smallbold">Sales From</th>
<th class="smallbold">Sales To</th>
<th class="smallbold">Travel From</th>
<th class="smallbold">Travel To</th>
<th class="smallbold">Created by</th>
</tr>
<% Do While Not rs.EOF %>
<tr>
<td class="small" align="center" valign="top"><a href=view.asp?id=<%=rs("id")%>><%=rs("id")%></a></td>
<td class="small" align="center" valign="top"><%=rs("promocode")%> </td>
<td class="small" align="center" valign="top"><%=rs("promostatus")%> </td>
<td class="small" align="center" valign="top"><%=rs("country")%> </td>
<td class="small" align="center" valign="top"><%=rs("salefrom")%> </td>
<td class="small" align="center" valign="top"><%=rs("saleto")%> </td>
<td class="small" align="center" valign="top"><%=rs("travelfrom")%> </td>
<td class="small" align="center" valign="top"><%=rs("travelto")%> </td>
<td class="small" align="center" valign="top"><%=rs("txtName")%> </td>
</tr>
<%
rs.MoveNext
Loop
%>
</table>