Thread: Databases?
View Single Post
  #1 (permalink)  
Old Mar 25th, 2008, 01:51
Apocalyptic Poet Apocalyptic Poet is offline
New Member
Join Date: Mar 2008
Location: No where in Particular
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Databases?

I know this must be annoying for veteran members, but I am a young, and inexperienced, person who is attempting to learn the bare necessities in asp in order to perform what is required of me. I am a high school student who was placed in charge of updating and maintaining a website at my school. I was wondering if anyone could tell me what the error is on the page I'm working with so I can display the statistics for the baseball team. Any help at all will be appreciated. I've been working on trying to figure out this problem on my own since the two teachers that could have helped me can't because one is a pure html teacher and the other hasn't used asp in a long time.

Code: Select all
<!-- #INCLUDE FILE="adovbs.inc" -->
<HTML>
<HEAD>
<TITLE>Simi Valley Pioneer Baseball - Stats</TITLE>
<META NAME="KEYWORDS" CONTENT="Pioneer Baseball, Simi Valley Pioneer Baseball,
Simi Valley Baseball, Simi Valley Highschool Baseball, Simi Baseball,
Simi Highschool Baseball, Simi High Baseball, Marmonte League">
<META NAME="DESCRIPTION" CONTENT="Simi Valley Pioneer Baseball - Stats">
<META NAME="COPYRIGHT" CONTENT="Copyright (c) 2007 by Simi Valley Pioneer Baseball, All Rights Reserved">
<META NAME="RATING" CONTENT="G">
<%
Dim objConn
Dim connStr
Dim strQuery
Dim rsMessageHitting
Dim rsMessagePitching
Dim rsMessageFielding
Set objConn = Server.CreateObject("ADODB.Connection")
connStr ="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("Database/VarsityStats.mdb")
objConn.Open(connStr)
strQuery = "SELECT * FROM Hitting ORDER BY ID ASC"
Set rsMessageHitting = objConn.Execute(strQuery)
strQuery = "SELECT * FROM Pitching ORDER BY ID ASC"
Set rsMessagePitching = objConn.Execute(strQuery)
strQuery = "SELECT * FROM Fielding ORDER BY ID ASC"
Set rsMessageFielding = objConn.Execute(strQuery)
%>
<STYLE>
<!--
A.Menu:link { color: #650000;text-decoration: none; }
A.Menu:visited { color: #650000;text-decoration: none; }
A.Menu:hover { color: #FFFFFF;text-decoration: none; }
A.SideBar:link img { color: #F8D307; border-color: #F8D307; text-decoration: none; }
A.SideBar:visited img { color: #F8D307; border-color: #F8D307; text-decoration: none; }
A.SideBar:hover img { color: #FFFFFF; border-color: #FFFFFF; text-decoration: none; }
A.SideBar:link { color: #F8D307;text-decoration: none; }
A.SideBar:visited { color: #F8D307;text-decoration: none; }
A.SideBar:hover { color: #FFFFFF;text-decoration: none; }
A.EMail:link { color: #000000;text-decoration: none; }
A.EMail:visited { color: #000000;text-decoration: none; }
A.EMail:hover { color: #650000;text-decoration: none; }
table.sortable a.sortheader {
background-color:#650000;
color:#FFFFFF;
font-weight: bold;
text-decoration: none;
display: block;
}
table.sortable span.sortarrow {
color: #FFFFFF;
text-decoration: none;
}
-->
</STYLE>
<SCRIPT SRC="JavaScript/SortTable.js"></SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" BACKGROUND="Images/SVHSBG.jpg" BGPROPERTIES="FIXED" TEXT="#650000" STYLE="FONT-FAMILY: Times New Roman">
<CENTER>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" STYLE="FONT-SIZE: 30pt; FONT-FAMILY: Times New Roman; FONT-WEIGHT: bold">
<TR>
<TD ALIGN="CENTER">Simi Valley Pioneer Baseball</TD>
</TR><TR>
<TD ALIGN="CENTER" STYLE="FONT-SIZE: 15pt">'Ya Gotta Believe'</TD>
</TR>
</TABLE>
<BR>
<SCRIPT LANGUAGE="JavaScript" SRC="JavaScript/Menu.js"></SCRIPT>
<BR>
<TABLE BORDER="1" WIDTH="100%" CELLSPACING="0" CELLPADDING="10" STYLE="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; BORDERCOLOR="#650000">
<TR>
<TD ROWSPAN="3" WIDTH="170" ALIGN="CENTER" VALIGN="TOP" BGCOLOR="#650000" STYLE="FONT-SIZE: 14pt; COLOR: #F8D307">
<U>Select Stat</U><BR><BR>
<A HREF="Stats.asp#Hitting" CLASS="SideBar">Hitting</A><BR><BR>
<A HREF="Stats.asp#Pitching" CLASS="SideBar">Pitching</A><BR><BR>
<A HREF="Stats.asp#Fielding" CLASS="SideBar">Fielding</A>
</TD>
<TD ALIGN="CENTER" VALIGN="TOP">
<A NAME="Hitting"></A>
<P ALIGN="CENTER" STYLE="FONT-FAMILY: Times New Roman; FONT-SIZE: 18pt; FONT-WEIGHT: bold; COLOR: #650000">2007 Hitting - Final</P>
<TABLE BORDER="1" CELLSPACING="2" CELLPADDING="2" CLASS="sortable" ID="Hitting" STYLE="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" BGCOLOR="#F8D307" BORDERCOLOR="#000000">
<TR>
<TH>Player</TH>
<TH>G</TH>
<TH>AB</TH>
<TH>R</TH>
<TH>H</TH>
<TH>2B</TH>
<TH>3B</TH>
<TH>HR</TH>
<TH>RBI</TH>
<TH>BB</TH>
<TH>SO</TH>
<TH>SB</TH>
<TH>CS</TH>
<TH>OBP</TH>
<TH>SLG</TH>
<TH>AVG</TH>
</TR>
<%
rsMessageHitting.MoveFirst 
While Not rsMessageHitting.EOF
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("<TR CLASS='sortbottom'>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("<TR>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("Player")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("G")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("AB")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("R")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("H")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("2B")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("3B")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("HR")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("RBI")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("BB")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("SO")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("SB")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageHitting("CS")%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessageHitting("OBP"),3)%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessageHitting("SLG"),3)%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessageHitting("AVG"),3)%><%
if rsMessageHitting("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"</TR>")
else
Response.Write("</TD>"+vbNewLine+"</TR>")
end if
rsMessageHitting.MoveNext 
Wend
%>
</TR>
</TABLE>
</TD>
</TR><TR>
<TD ALIGN="CENTER" VALIGN="TOP">
<A NAME="Pitching"></A>
<P ALIGN="CENTER" STYLE="FONT-FAMILY: Times New Roman; FONT-SIZE: 18pt; FONT-WEIGHT: bold; COLOR: #650000">2007 Pitching - Final</P>
<TABLE BORDER="1" CELLSPACING="2" CELLPADDING="2" CLASS="sortable" ID="Pitching" STYLE="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" BGCOLOR="#F8D307" BORDERCOLOR="#000000">
<TR>
<TH>Player</TH>
<TH>W</TH>
<TH>L</TH>
<TH>ERA</TH>
<TH>GP</TH>
<TH>GS</TH>
<TH>CG</TH>
<TH>SHO</TH>
<TH>SV</TH>
<TH>IP</TH>
<TH>H</TH>
<TH>R</TH>
<TH>ER</TH>
<TH>HR</TH>
<TH>HBP</TH>
<TH>BB</TH>
<TH>SO</TH>
</TR>
<%
rsMessagePitching.MoveFirst 
While Not rsMessagePitching.EOF
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("<TR CLASS='sortbottom'>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("<TR>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("Player")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("W")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("L")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessagePitching("ERA"),2)%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("GP")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("GS")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("CG")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("SHO")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("SV")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessagePitching("IP"),2)%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("H")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("R")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("ER")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("HR")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("HBP")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("BB")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessagePitching("SO")%><%
if rsMessagePitching("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"</TR>")
else
Response.Write("</TD>"+vbNewLine+"</TR>")
end if
rsMessagePitching.MoveNext 
Wend
%>
</TR>
</TABLE>
</TD>
</TR><TR>
<TD ALIGN="CENTER" VALIGN="TOP">
<A NAME="Fielding"></A>
<P ALIGN="CENTER" STYLE="FONT-FAMILY: Times New Roman; FONT-SIZE: 18pt; FONT-WEIGHT: bold; COLOR: #650000">2007 Fielding - Final</P>
<TABLE BORDER="1" CELLSPACING="2" CELLPADDING="2" CLASS="sortable" ID="Fielding" STYLE="FONT-SIZE: 10pt; FONT-FAMILY: Verdana" BGCOLOR="#F8D307" BORDERCOLOR="#000000">
<TR>
<TH>Player</TH>
<TH>G</TH>
<TH>Inn</TH>
<TH>PO</TH>
<TH>Asst</TH>
<TH>EF</TH>
<TH>ET</TH>
<TH>Errors</TH>
<TH>Field%</TH>
<TH>PB</TH>
<TH>CS</TH>
<TH>SB</TH>
</TR>
<%
rsMessageFielding.MoveFirst 
While Not rsMessageFielding.EOF
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("<TR CLASS='sortbottom'>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("<TR>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("Player")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("G")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("Inn")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("PO")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("Asst")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD><TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("EF")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("ET")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("Errors")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=FormatNumber(rsMessageFielding("Field%"),3)%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("PB")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("CS")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"<TD ALIGN='CENTER'><B>")
else
Response.Write("</TD>"+vbNewLine+"<TD ALIGN='CENTER'>")
end if
%><%=rsMessageFielding("SB")%><%
if rsMessageFielding("Player") = "Total for Team" then
Response.Write("</B></TD>"+vbNewLine+"</TR>")
else
Response.Write("</TD>"+vbNewLine+"</TR>")
end if
rsMessageFielding.MoveNext 
Wend
%>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<% objConn.Close() %>
</CENTER>
</BODY>
</HTML>

Last edited by saltedm8; Mar 25th, 2008 at 10:15. Reason: added [code] tags
Reply With Quote