- ASP - Database Table Display
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·What's New?
Mail List


Alphabetic Database Display
Alphabetic navigation of a database provides a unique way to display just about data.  A simple for next loop generates all of the alphabetic hyperlinks into the database and an sql statement targeted to the first letter in the targeted field allows for alphabetic displaying of data.  Utilizing our database with all fifty states in it we will hyperlink the letters A-Z and based on that input search the data for all states that begin with the letter the user clicked on.
View the Output
Text View
Print View
Mail this Link
Download the Code
View the Data

<title>Alphabetic Database Display</title>
<body bgcolor="#FFFFFF">
for counter = 65 to 90
' for next routine to create hyperlinks alphabetically targeted
' to the current page 

<a href="<%= request.servervariables("script_name")%>?u_letter=&#<%= counter %>;">
&#<%= counter %>;</a> 
<% next %>

'if the user clicked a link then search the db
if u_letter<>"" then
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
Set rs = Server.CreateObject("ADODB.Recordset")

sql = "select * from states where left(statename,1)='"& u_letter &"' order by statename asc"

rs.Open sql, cn
'if the search ends in no results display a
'no results found mesage
if rs.eof then

No states begin with the letter <%= u_letter %>
<% else 
do while not rs.eof
'display all observations found

<%= rs("statename") %>
end if ' end check for obs
end if ' end check for user input




ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement is hosted by
    Donate Food Online with a Mouse Click at
    Donate Land Online with a Mouse Click at
    © 1999 - 2018
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3