ALAlabama
AKAlaska
AZArizona
ARArkansas
CACalifornia
COColorado
CTConnecticut
DEDelaware
DCDistrict Of Columbia
FLFlorida
GAGeorgia
HIHawaii
IDIdaho
ILIllinois
INIndiana
IAIowa
KSKansas
KYKentucky
LALouisiana
MEMaine
MDMaryland
MAMassachusetts
MIMichigan
MNMinnesota
MSMississippi
MOMissouri
MTMontana
NENebraska
NVNevada
NHNew Hampshire
NJNew Jersey
NMNew Mexico
NYNew York
NCNorth Carolina
NDNorth Dakota
OHOhio
OKOklahoma
OROregon
PAPennsylvania
PRPuerto Rico
RIRhode Island
SCSouth Carolina
SDSouth Dakota
TNTennessee
TXTexas
UTUtah
VTVermont
VIVirgin Islands
VAVirginia
WAWashington
WVWest Virginia
WIWisconsin
WYWyoming

 

Code

<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
<%
Option Explicit
Session.CodePage=65001
Response.Charset="UTF-8"

' no browser caching of this page !! to be used on all pages
Response.Expires=-1
Response.ExpiresAbsolute = Now() - 1

' do not allow proxy servers to cache this page !! to be used on all pages
Response.CacheControl="private"
Response.CacheControl="no-cache"
Response.CacheControl="no-store"
%>
<!--#include virtual="/include/paramSQL.asp"-->
<%
function writeStateTable()
    ' db_cmdText and db_rs are predefined

    ' our SQL command
    db_cmdText = "SELECT Code, Description FROM states ORDER BY Description;"

    ' open a command object on our database
    openCommand Application("examples"), "database3 1"

    ' get our recordset using the open command object
    getRS db_rs, db_cmdText, "database3 2"

    Dim tableHTML

    if NOT (db_rs.bof AND db_rs.eof) then
        tableHTML = "<table id=""statesTable"">"
        while NOT db_rs.eof
            tableHTML = tableHTML & "<tr><td>" & db_rs("Code") & "</td><td>" & db_rs("Description") & "</td></tr>"
            db_rs.movenext
        wend
        tableHTML = tableHTML & "</table>"
    end if

    ' clean up
    closeRS
    closeCommand
    writeStateTable = tableHTML
end function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>rodsdot.com :: generic database page - states table</title>
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="&copy; 2005 Roderick Divilbiss">
<style type="text/css">
<!--
#statesTable {
    border: 1px solid #000;
    border-collapse: collapse;
}

#statesTable td {
    border: 1px solid #000;
    padding:2px 5px 2px 5px;
}

.code {
    font-family:Courier New;
    font-size:8pt;
    color:#000000;
    border:1px dashed #000000;
    padding:5px;
    background-color:#F4F4FF
}
-->
</style>
</head>
<body>
<%=writeStateTable%>
</table>
</body>

</html>