<html>
<head>
<title>The Salt Lake Tribune -- 2004 Oscars Poll</title>
</head>
<body>
<%

dim OBJdbConn, SQLretrieve, SQLresult,sqlCount,OBJcount,SQLdelete

        Set OBJdbConn = Server.CreateObject("ADODB.Connection")
        OBJdbConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
                Server.MapPath("db/oscars.mdb") & ";"
        OBJdbConn.Open

'SQLretrieve = "SELECT * FROM oscarcontest where fname ='Steven' and lname= 'Koehler' and actor='Russell Crowe' and picture='Gladiator' and director='Steven Soderberg for Traffic' and actress='Julia Roberts' and supactor='Benicio Del Toro'"

SQLretrieve = "SELECT * FROM oscarcontest"

Set SQLresult= OBJdbConn.Execute(SQLretrieve)


'delete all the blank records
'SQLdelete= "DELETE oscarcontest where fname=''"
'OBJdbConn.execute(SQLdelete)

'count all the records
set OBJcount=Server.CreateObject("ADODB.Recordset")
OBJcount.open SQLretrieve, OBJdbConn, 3
sqlCount= OBJcount.recordcount

%>



<b>Total Records: </b><%= sqlCount %>
<br>
<hr width=50 align=left>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
  <tr>
    <td><strong>Actor</strong></td>
    <td><strong>Actress</strong></td>
    <td><strong>Sup Actor</strong></td>
    <td><strong>Sup Actress</strong></td>
    <td><strong>Director</strong></td>
    <td><strong>Picture</strong></td>
    <td><strong>Tie</strong></td>
    <td><strong>Name</strong></td>
    <td><strong>Address</strong></td>
    <td><strong>City, State</strong></td>
    <td><strong>E-mail</strong></td>
  </tr>
  <% do while not SQLresult.eof 
  if bgcolor="FFFFFF" then 
  bgcolor="CCCCCC" 
  else
  bgcolor="FFFFFF" 
  end if %>
  <tr bgcolor="<%=bgcolor%>">
    <td><%= SQLresult("actor") %></td>
    <td><%= SQLresult("actress") %></td>
    <td><%= SQLresult("supactor") %></td>
    <td><%= SQLresult("supactress") %></td>
    <td><%= SQLresult("director") %></td>
    <td><%= SQLresult("picture") %></td>
    <td>&nbsp;<%= SQLresult("tie") %></td>
    <td><%= SQLresult("fname") %> &nbsp;<%= SQLresult("lname") %></td>
    <td><%= SQLresult("street") %></td>
    <td><%= SQLresult("city") %>, <%= SQLresult("state") %></td>
    <td><%= SQLresult("email") %></td>
  </tr>
  <% SQLresult.movenext
loop %>
</table>

<br>
<%OBJdbConn.close %>
</body>
</html>
