Forums
This topic is locked
Help Please - very strange problem
Posted 03 Apr 2007 20:52:34
1
has voted
03 Apr 2007 20:52:34 Chest Rockwell posted:
I have rebuilt a football (soccer) website. The database is in Access as this was the orginal database too, I have constructed a query that sorts other querys and displays a league table with games played, points, wins, draws, loses, Goals For, Goals Against, etc....When I run the query in Access it sorts all the information perfectly, when I create a recordset in Dreamweaver (using asp) and test the connection with a WHERE statement based on a querystring it all works fine too.
However when I actually upload the asp page it does not show the same data as the test connection.
Has anybody had any similar problems as this???
As I am currently out of my country I don't have access to the code and database at this time but I should do shortly and repost to this string.
Replies
Replied 04 Apr 2007 07:54:27
04 Apr 2007 07:54:27 Chest Rockwell replied:
Here is the code on the page:
<pre id=code><font face=courier size=2 id=code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/futuresoccer.asp" -->
<!--#include file="inc.location.asp" -->
<%
Dim rsTables__MMColParam
rsTables__MMColParam = "1"
If (Request.QueryString("LeagueID" <> "" Then
rsTables__MMColParam = Request.QueryString("LeagueID"
End If
%>
<%
Dim rsTables
Dim rsTables_numRows
Set rsTables = Server.CreateObject("ADODB.Recordset"
rsTables.ActiveConnection = MM_futuresoccer_STRING
rsTables.Source = "SELECT * FROM quNewTables WHERE LeagueID = " + Replace(rsTables__MMColParam, "'", "''" + ""
rsTables.CursorType = 0
rsTables.CursorLocation = 2
rsTables.LockType = 1
rsTables.Open()
rsTables_numRows = 0
%>
<%
Dim rsLeagues__MMColParam
rsLeagues__MMColParam = "1"
If (Request.QueryString("LeagueID" <> "" Then
rsLeagues__MMColParam = Request.QueryString("LeagueID"
End If
%>
<%
Dim rsLeagues
Dim rsLeagues_numRows
Set rsLeagues = Server.CreateObject("ADODB.Recordset"
rsLeagues.ActiveConnection = MM_futuresoccer_STRING
rsLeagues.Source = "SELECT tblLeague.LeagueID, tblLeagueType.LeagueType, tblDays.Day, tblDivisions.Division, tblSeasons.Name FROM (((tblLeague INNER JOIN tblLeagueType ON tblLeague.LeagueTypeID = tblLeagueType.LeagueTypeID) INNER JOIN tblDays ON tblLeague.DayID = tblDays.DayID) INNER JOIN tblDivisions ON tblLeague.DivisionID = tblDivisions.DivisionID) INNER JOIN tblSeasons ON tblLeague.SeasonID = tblSeasons.SeasonID WHERE tblLeague.LeagueID = " + Replace(rsLeagues__MMColParam, "'", "''" + ""
rsLeagues.CursorType = 0
rsLeagues.CursorLocation = 2
rsLeagues.LockType = 1
rsLeagues.Open()
rsLeagues_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsTables_numRows = rsTables_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>League Table > Futuresoccer | 5-A-Side</title>
<meta name="description" content="Template Description">
<meta name="keywords" content="Template Keywords">
<meta http-equiv="imagetoolbar" content="no" />
<script type="text/javascript" language="javascript" src="scripts/navigation.js"></script>
<style type="text/css">
<!--
@import url("styles/future_screen.css"
.style1 {color: #99021B}
-->
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1><a href="index.asp" title="Futuresoccer Home"><span>Futuresoccer | 5-A-Side</span></a></h1>
<h2><%=rsLocation("Location"%> Leagues</h2>
</div>
<div id="content">
<div id="nav">
<!--#include file="inc.navigation.asp" -->
</div>
<div id="mainbody">
<h3><%=(rsLeagues.Fields.Item("LeagueType".Value)%> - <%=(rsLeagues.Fields.Item("Name".Value)%></h3>
<h4 style="margin-bottom:10px;"><%=(rsLeagues.Fields.Item("Day".Value)%> - <%=(rsLeagues.Fields.Item("Division".Value)%></h4>
<% If rsTables.EOF And rsTables.BOF Then %>
<P>There are currently no league tables for this league.</P>
<% Else %>
<P><strong>Scoring:</strong> <span class="style1">3</span> pts for a win, <span class="style1">1</span> for a draw, <span class="style1">0</span> for a loss.</P>
<table width="560" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" style="margin-top:10px;">
<tr>
<th valign="top" bgcolor="#99021B"><p>Team</p></th>
<th valign="top" bgcolor="#99021B"><p>Played</p></th>
<th valign="top" bgcolor="#99021B"><p>W</p></th>
<th valign="top" bgcolor="#99021B"><p>D</p></th>
<th valign="top" bgcolor="#99021B"><p>L</p></th>
<th valign="top" bgcolor="#99021B"><p>GF</p></th>
<th valign="top" bgcolor="#99021B"><p>GA</p></th>
<th valign="top" bgcolor="#99021B"><p>GD</p></th>
<th valign="top" bgcolor="#99021B"><p>Points</p></th>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsTables.EOF))
%>
<tr>
<td valign="top" bgcolor="#FFFFFF"><p><strong><%=(rsTables.Fields.Item("TeamName".Value)%></strong></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfPlayed".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfWon".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfDrawn".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfLost".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalsFor".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalsAgainst".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalDifference".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><strong><%=(rsTables.Fields.Item("SumOfPoints".Value)%></strong></p></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsTables.MoveNext()
Wend
%>
</table>
<p style="margin-top:10px;">Any teams that have not completed their <U>first</U> league game are NOT included in the league table.</p>
<p>Once their first game has been completed they will feature</p>
<% End If ' end rsTables.EOF And rsTables.BOF %>
<p><a href="javascript:history.back()">Back To Leagues</a> </p>
</div>
</div>
<div id="footer">
<p id="subnav"><a href="index.asp" title="Home">Home</a> |
<a href="contact-us.asp" title="Contact Us">Contact Us</a> |
<a href="terms.asp" title="Terms & Conditions">Terms & Conditions</a> |
<a href="location.asp" title="Location">Location</a></p>
<p id="copyright">© Futuresoccer Ltd <%=year(date)%>. All rights reserved.</p>
<p id="footermail"><a href="mailto: " title=" "><span> </a></p>
</div>
</div>
</body>
</html>
<%
rsTables.Close()
Set rsTables = Nothing
%>
<%
rsLeagues.Close()
Set rsLeagues = Nothing
%>
<!--#include file="inc.location_close.asp" --> </font id=code></pre id=code>
The rsTables recordset connection is the one that when tested in dreamweaver pulls out the data from Access perfectly.
If I can get the database then I will post that too - but any help is appricated.
The page can be viewed live at:
www.futuresoccer.co.uk/league-table.asp?LeagueID=11
<pre id=code><font face=courier size=2 id=code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/futuresoccer.asp" -->
<!--#include file="inc.location.asp" -->
<%
Dim rsTables__MMColParam
rsTables__MMColParam = "1"
If (Request.QueryString("LeagueID" <> "" Then
rsTables__MMColParam = Request.QueryString("LeagueID"
End If
%>
<%
Dim rsTables
Dim rsTables_numRows
Set rsTables = Server.CreateObject("ADODB.Recordset"
rsTables.ActiveConnection = MM_futuresoccer_STRING
rsTables.Source = "SELECT * FROM quNewTables WHERE LeagueID = " + Replace(rsTables__MMColParam, "'", "''" + ""
rsTables.CursorType = 0
rsTables.CursorLocation = 2
rsTables.LockType = 1
rsTables.Open()
rsTables_numRows = 0
%>
<%
Dim rsLeagues__MMColParam
rsLeagues__MMColParam = "1"
If (Request.QueryString("LeagueID" <> "" Then
rsLeagues__MMColParam = Request.QueryString("LeagueID"
End If
%>
<%
Dim rsLeagues
Dim rsLeagues_numRows
Set rsLeagues = Server.CreateObject("ADODB.Recordset"
rsLeagues.ActiveConnection = MM_futuresoccer_STRING
rsLeagues.Source = "SELECT tblLeague.LeagueID, tblLeagueType.LeagueType, tblDays.Day, tblDivisions.Division, tblSeasons.Name FROM (((tblLeague INNER JOIN tblLeagueType ON tblLeague.LeagueTypeID = tblLeagueType.LeagueTypeID) INNER JOIN tblDays ON tblLeague.DayID = tblDays.DayID) INNER JOIN tblDivisions ON tblLeague.DivisionID = tblDivisions.DivisionID) INNER JOIN tblSeasons ON tblLeague.SeasonID = tblSeasons.SeasonID WHERE tblLeague.LeagueID = " + Replace(rsLeagues__MMColParam, "'", "''" + ""
rsLeagues.CursorType = 0
rsLeagues.CursorLocation = 2
rsLeagues.LockType = 1
rsLeagues.Open()
rsLeagues_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsTables_numRows = rsTables_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>League Table > Futuresoccer | 5-A-Side</title>
<meta name="description" content="Template Description">
<meta name="keywords" content="Template Keywords">
<meta http-equiv="imagetoolbar" content="no" />
<script type="text/javascript" language="javascript" src="scripts/navigation.js"></script>
<style type="text/css">
<!--
@import url("styles/future_screen.css"
.style1 {color: #99021B}
-->
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1><a href="index.asp" title="Futuresoccer Home"><span>Futuresoccer | 5-A-Side</span></a></h1>
<h2><%=rsLocation("Location"%> Leagues</h2>
</div>
<div id="content">
<div id="nav">
<!--#include file="inc.navigation.asp" -->
</div>
<div id="mainbody">
<h3><%=(rsLeagues.Fields.Item("LeagueType".Value)%> - <%=(rsLeagues.Fields.Item("Name".Value)%></h3>
<h4 style="margin-bottom:10px;"><%=(rsLeagues.Fields.Item("Day".Value)%> - <%=(rsLeagues.Fields.Item("Division".Value)%></h4>
<% If rsTables.EOF And rsTables.BOF Then %>
<P>There are currently no league tables for this league.</P>
<% Else %>
<P><strong>Scoring:</strong> <span class="style1">3</span> pts for a win, <span class="style1">1</span> for a draw, <span class="style1">0</span> for a loss.</P>
<table width="560" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" style="margin-top:10px;">
<tr>
<th valign="top" bgcolor="#99021B"><p>Team</p></th>
<th valign="top" bgcolor="#99021B"><p>Played</p></th>
<th valign="top" bgcolor="#99021B"><p>W</p></th>
<th valign="top" bgcolor="#99021B"><p>D</p></th>
<th valign="top" bgcolor="#99021B"><p>L</p></th>
<th valign="top" bgcolor="#99021B"><p>GF</p></th>
<th valign="top" bgcolor="#99021B"><p>GA</p></th>
<th valign="top" bgcolor="#99021B"><p>GD</p></th>
<th valign="top" bgcolor="#99021B"><p>Points</p></th>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsTables.EOF))
%>
<tr>
<td valign="top" bgcolor="#FFFFFF"><p><strong><%=(rsTables.Fields.Item("TeamName".Value)%></strong></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfPlayed".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfWon".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfDrawn".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfLost".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalsFor".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalsAgainst".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><%=(rsTables.Fields.Item("SumOfGoalDifference".Value)%></p></td>
<td align="center" valign="top" bgcolor="#FFFFFF"><p><strong><%=(rsTables.Fields.Item("SumOfPoints".Value)%></strong></p></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsTables.MoveNext()
Wend
%>
</table>
<p style="margin-top:10px;">Any teams that have not completed their <U>first</U> league game are NOT included in the league table.</p>
<p>Once their first game has been completed they will feature</p>
<% End If ' end rsTables.EOF And rsTables.BOF %>
<p><a href="javascript:history.back()">Back To Leagues</a> </p>
</div>
</div>
<div id="footer">
<p id="subnav"><a href="index.asp" title="Home">Home</a> |
<a href="contact-us.asp" title="Contact Us">Contact Us</a> |
<a href="terms.asp" title="Terms & Conditions">Terms & Conditions</a> |
<a href="location.asp" title="Location">Location</a></p>
<p id="copyright">© Futuresoccer Ltd <%=year(date)%>. All rights reserved.</p>
<p id="footermail"><a href="mailto: " title=" "><span> </a></p>
</div>
</div>
</body>
</html>
<%
rsTables.Close()
Set rsTables = Nothing
%>
<%
rsLeagues.Close()
Set rsLeagues = Nothing
%>
<!--#include file="inc.location_close.asp" --> </font id=code></pre id=code>
The rsTables recordset connection is the one that when tested in dreamweaver pulls out the data from Access perfectly.
If I can get the database then I will post that too - but any help is appricated.
The page can be viewed live at:
www.futuresoccer.co.uk/league-table.asp?LeagueID=11
Replied 04 Apr 2007 22:28:18
04 Apr 2007 22:28:18 Chest Rockwell replied:
Turns out you can't attach files so the database is here
www.da-wai.com/futuresoccer/database/future_soccer_v2.mdb
www.da-wai.com/futuresoccer/database/future_soccer_v2.mdb