I'm trying to display data from a table that starts with whatever letter the user clicked on.
I have letters a to z as links. When a user clicks on a letter, I would like data from the table that starts with that letter, to be displayed. My code has an error in the Select statement - set rs=con.execute("select * from players where yahoosn like "&'letter%'&" order by yahoosn"). Can someone please help me fix that? The table has just 2 columns - yahoosn and a picPath
<html></head>
<body>
<%
letter=request.querystring("letter")
'response.write letter'
set con=server.createObject("adodb.connection")
con.open "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("db/ufp.mdb")
set rs=con.execute("select * from players where yahoosn like "&'letter%'&" order by yahoosn")
%>
<p>
<a href="players.asp?letter=a">a</a> |
<a href="players.asp?letter=b">b</a> |
<a href="players.asp?letter=c">c</a> |
<a href="players.asp?letter=d">d</a> |
<a href="players.asp?letter=e">e</a> |
<a href="players.asp?letter=f">f</a> |
<a href="players.asp?letter=g">g</a> |
<a href="players.asp?letter=h">h</a> |
<a href="players.asp?letter=i">i</a> |
<a href="players.asp?letter=j">j</a> |
<a href="players.asp?letter=k">k</a> |
<a href="players.asp?letter=l">l</a> |
<a href="players.asp?letter=m">m</a> |
<a href="players.asp?letter=n">n</a> |
<a href="players.asp?letter=o">o</a> |
<a href="players.asp?letter=p">p</a> |
<a href="players.asp?letter=q">q</a> |
<a href="players.asp?letter=r">r</a> |
<a href="players.asp?letter=s">s</a> |
<a href="players.asp?letter=t">t</a> |
<a href="players.asp?letter=u">u</a> |
<a href="players.asp?letter=v">v</a> |
<a href="players.asp?letter=w">w</a> |
<a href="players.asp?letter=x">x</a> |
<a href="players.asp?letter=y">y</a> |
<a href="players.asp?letter=z">z</a>
</p>
<%
while not rs.eof
response.write rs("yahoosn")
rs.movenext
wend
%>
</body></html>