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


Simple Table Display (Select Fields)
Displaying data from an Access or SQL Server database is easy to accomplish in .asp. The following example utilizes our Access database of Mark 'The Bird' Fidrych and selects specific season statistics contained in the database for display based upon what appears in the select statement in our sql query. A query utilizing select * will bring across every table element and if every element is not needed resource has been wasted. In addition select will not allow grouping function which may be critical for some applications.
View the Output
Text View
Print View
Mail this Link
Download the Code
View the Data

<title> Table with Select Fields(Hard-Coded))</title>
<body bgcolor="#FFFFFF">
' Name of the Accessdb being read

' Connect to the db with a DSN-less connection
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)

' Create a server recordset object
Set rs = Server.CreateObject("ADODB.Recordset")

' Select specific fields from the table the_bird
sql = "select year, team, w, l, cg, so, era from the_bird" 

' Execute the sql
rs.Open sql, cn

<table BORDER="1" align="center" width="500">


' Move to the first record

' Start a loop that will end with the last record
do while not rs.eof

<%= rs("year") %>

<%= rs("team") %>

<%= rs("w") %>

<%= rs("l") %>

<%= rs("cg") %>

<%= rs("so") %>

<%= rs("era") %>

' Move to the next record
' Loop back to the do statement
loop %>



' Close and set the recordset to nothing
set rs=nothing




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