Forums

ASP

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>&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include file="Connections/futuresoccer.asp" --&gt;
&lt;!--#include file="inc.location.asp" --&gt;
&lt;%
Dim rsTables__MMColParam
rsTables__MMColParam = "1"
If (Request.QueryString("LeagueID" &lt;&gt; "" Then
rsTables__MMColParam = Request.QueryString("LeagueID"
End If
%&gt;
&lt;%
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
%&gt;
&lt;%
Dim rsLeagues__MMColParam
rsLeagues__MMColParam = "1"
If (Request.QueryString("LeagueID" &lt;&gt; "" Then
rsLeagues__MMColParam = Request.QueryString("LeagueID"
End If
%&gt;
&lt;%
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
%&gt;
&lt;%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsTables_numRows = rsTables_numRows + Repeat1__numRows
%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;League Table &gt; Futuresoccer | 5-A-Side&lt;/title&gt;
&lt;meta name="description" content="Template Description"&gt;
&lt;meta name="keywords" content="Template Keywords"&gt;
&lt;meta http-equiv="imagetoolbar" content="no" /&gt;
&lt;script type="text/javascript" language="javascript" src="scripts/navigation.js"&gt;&lt;/script&gt;
&lt;style type="text/css"&gt;
&lt;!--
@import url("styles/future_screen.css";
.style1 {color: #99021B}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container"&gt;
&lt;div id="header"&gt;
&lt;h1&gt;&lt;a href="index.asp" title="Futuresoccer Home"&gt;&lt;span&gt;Futuresoccer | 5-A-Side&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;h2&gt;&lt;%=rsLocation("Location"%&gt; Leagues&lt;/h2&gt;
&lt;/div&gt;
&lt;div id="content"&gt;
&lt;div id="nav"&gt;
&lt;!--#include file="inc.navigation.asp" --&gt;
&lt;/div&gt;
&lt;div id="mainbody"&gt;
&lt;h3&gt;&lt;%=(rsLeagues.Fields.Item("LeagueType".Value)%&gt; - &lt;%=(rsLeagues.Fields.Item("Name".Value)%&gt;&lt;/h3&gt;
&lt;h4 style="margin-bottom:10px;"&gt;&lt;%=(rsLeagues.Fields.Item("Day".Value)%&gt; - &lt;%=(rsLeagues.Fields.Item("Division".Value)%&gt;&lt;/h4&gt;

&lt;% If rsTables.EOF And rsTables.BOF Then %&gt;
&lt;P&gt;There are currently no league tables for this league.&lt;/P&gt;
&lt;% Else %&gt;
&lt;P&gt;&lt;strong&gt;Scoring:&lt;/strong&gt; &lt;span class="style1"&gt;3&lt;/span&gt; pts for a win, &lt;span class="style1"&gt;1&lt;/span&gt; for a draw, &lt;span class="style1"&gt;0&lt;/span&gt; for a loss.&lt;/P&gt;
&lt;table width="560" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" style="margin-top:10px;"&gt;
&lt;tr&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;Team&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;Played&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;W&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;D&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;L&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;GF&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;GA&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;GD&lt;/p&gt;&lt;/th&gt;
&lt;th valign="top" bgcolor="#99021B"&gt;&lt;p&gt;Points&lt;/p&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;%
While ((Repeat1__numRows &lt;&gt; 0) AND (NOT rsTables.EOF))
%&gt;
&lt;tr&gt;
&lt;td valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;strong&gt;&lt;%=(rsTables.Fields.Item("TeamName".Value)%&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfPlayed".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfWon".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfDrawn".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfLost".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfGoalsFor".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfGoalsAgainst".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;%=(rsTables.Fields.Item("SumOfGoalDifference".Value)%&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td align="center" valign="top" bgcolor="#FFFFFF"&gt;&lt;p&gt;&lt;strong&gt;&lt;%=(rsTables.Fields.Item("SumOfPoints".Value)%&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsTables.MoveNext()
Wend
%&gt;
&lt;/table&gt;
&lt;p style="margin-top:10px;"&gt;Any teams that have not completed their &lt;U&gt;first&lt;/U&gt; league game are NOT included in the league table.&lt;/p&gt;
&lt;p&gt;Once their first game has been completed they will feature&lt;/p&gt;
&lt;% End If ' end rsTables.EOF And rsTables.BOF %&gt;
&lt;p&gt;&lt;a href="javascript:history.back()"&gt;Back To Leagues&lt;/a&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id="footer"&gt;
&lt;p id="subnav"&gt;&lt;a href="index.asp" title="Home"&gt;Home&lt;/a&gt; |
&lt;a href="contact-us.asp" title="Contact Us"&gt;Contact Us&lt;/a&gt; |
&lt;a href="terms.asp" title="Terms & Conditions"&gt;Terms & Conditions&lt;/a&gt; |
&lt;a href="location.asp" title="Location"&gt;Location&lt;/a&gt;&lt;/p&gt;
&lt;p id="copyright"&gt;&copy; Futuresoccer Ltd &lt;%=year(date)%&gt;. All rights reserved.&lt;/p&gt;
&lt;p id="footermail"&gt;&lt;a href="mailto: " title=" "&gt;&lt;span&gt; &lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsTables.Close()
Set rsTables = Nothing
%&gt;
&lt;%
rsLeagues.Close()
Set rsLeagues = Nothing
%&gt;
&lt;!--#include file="inc.location_close.asp" --&gt; </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

Reply to this topic