Hi guys
I'm working on a web-based footy tipping comp that pulls data from Excel sheets.
CS4 is giving me the following error:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/Footy/TippingSubmitTest14.asp, line 195
Line 195 is highlighted below with a smilie, but I suspect it's another part of the code causing the problem - not sure why though.
New to web design and dreamweaver, so hoping someone has time to check my code.
Cheers
AussieM8
PS - if I don't put the last bit of the code (ie. UpdateRound) as a subroutine and put it in as standard HTML near the top, it works OK
================================================== ==
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Submit Tips</title>
</head>
<body>
NRL Footy Tipping
<p>
<label for="Drop_TipsterName">Tipster Name:</label>
<select name="Drop_TipsterName" id="Drop_TipsterName">
<%
Call ShowTipsters
%>
</select>
<label for="Drop_RoundNo"><br>Round:</label>
<select name="Drop_RoundNo" size="1" id="Drop_RoundNo">
<%
Call ShowRounds
%>
</select>
<%
Call UpdateRound
%>
</body>
</html>
<%
Sub ShowTipsters()
' Obtain Tipsternames
Set oConn1 = Server.CreateObject("ADODB.connection")
oConn1.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
"DBQ=c:\Inetpub\wwwroot\Footy\Data_TipsterDetails. xls;" &_
"DefaultDir = c:\Inetpub\wwwroot\Footy\"
Set RS=Server.CreateObject("ADODB.recordset")
'retrieve dropdown menu contents
RS.open "SELECT TipsterName FROM TipsterDetails", oConn1
'populate dropdown
Do Until rs.EOF
response.write "<OPTION>" & RS("TipsterName") & "</OPTION>"
rs.MoveNext
Loop
'Close the recordset/connection
RS.Close
oConn1.Close
Set RS = Nothing
End Sub
Sub ShowRounds()
' Obtain RoundNo
Set oConn2 = Server.CreateObject("ADODB.connection")
oConn2.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
"DBQ=c:\Inetpub\wwwroot\Footy\Data_RoundDetails.xl s;" &_
"DefaultDir = c:\Inetpub\wwwroot\Footy\"
Set RS=Server.CreateObject("ADODB.recordset")
'retrieve dropdown menu contents
RS.open "SELECT RoundNo FROM RoundDetails", oConn2
'populate dropdown
Do Until rs.EOF
response.write "<OPTION>" & RS("RoundNo") & "</OPTION>"
rs.MoveNext
Loop
'Close the recordset/connection
RS.Close
oConn2.Close
Set RS = Nothing
End Sub
Sub UpdateRound()
Dim HomeTeam (10)
Dim AwayTeam (10)
Dim GameLocation (10)
Dim GameTime (10)
' Obtain Games for current Round
Set oConn3 = Server.CreateObject("ADODB.connection")
oConn3.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
"DBQ=c:\Inetpub\wwwroot\Footy\Data_Draw.xls;" &_
"DefaultDir = c:\Inetpub\wwwroot\Footy\"
Set RS=Server.CreateObject("ADODB.recordset")
RoundNo = "1"
Season = "2010"
GamesThisRound = 0
' Write the SQL Query
RS.open "SELECT * FROM draw_data", oConn3
'Find Date of This Round
do until RS("YrRnd") = Season & RoundNo
RS.movenext
Loop
'Write Round Date
Response.Write (": " & RS("Date") & "<br/>" )
'Write Games This Round
do until RS.EOF
If RS("YrRnd") = Season & RoundNo Then
GamesThisRound = GamesThisRound + 1
' Response.Write ( RS("HomeTeam") & " v " & RS("AwayTeam") & " - " & RS("Location") & " at " & RS("Time") & "<br/>" )
HomeTeam (GamesThisRound) = RS("HomeTeam")
AwayTeam (GamesThisRound) = RS("AwayTeam")
GameLocation (GamesThisRound) = RS("Location")
GameTime (GamesThisRound) = RS("Time")
End If
RS.movenext
Loop
'Close the recordset/connection
RS.Close
oConn3.Close
Set RS = Nothing
%>
Please make your team selections:
<form name="frm_Game1" id="frm_Game1" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game1Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(1)%> v <%=AwayTeam(1)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game1Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(1)%> at <%=GameTime(1)%>
</form>
<form name="frm_Game2" id="frm_Game2" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game2Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(2)%> v <%=AwayTeam(2)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game2Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(2)%> at <%=GameTime(2)%>
</form>
<form name="frm_Game3" id="frm_Game3" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game3Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(3)%> v <%=AwayTeam(3)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game3Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(3)%> at <%=GameTime(3)%>
</form>
<form name="frm_Game4" id="frm_Game4" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game4Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(4)%> v <%=AwayTeam(4)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game4Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(4)%> at <%=GameTime(4)%>
</form>
<form name="frm_Game5" id="frm_Game5" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game5Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(5)%> v <%=AwayTeam(5)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game5Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(5)%> at <%=GameTime(5)%>
</form>
<form name="frm_Game6" id="frm_Game6" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game6Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(6)%> v <%=AwayTeam(6)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game6Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(6)%> at <%=GameTime(6)%>
</form>
<form name="frm_Game7" id="frm_Game7" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game7Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(7)%> v <%=AwayTeam(7)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game7Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(7)%> at <%=GameTime(7)%>
</form>
<form name="frm_Game8" id="frm_Game8" runat="server">
<input id="rdo_HomeTeam" type="radio" value="0" name="Game8Selection" onClick="CalculateTipcode(this.value);">
<%=HomeTeam(8)%> v <%=AwayTeam(8)%>
<input id="rdo_AwayTeam" type="radio" value="1" name="Game8Selection" onClick="CalculateTipcode(this.value);">
- <%=GameLocation(8)%> at <%=GameTime(8)%>
</form>
<p>Knockout Game:
<input id="rdo_HomeKO" type="radio" value="0" name="Game9Selection" onClick="CalculateTipcode(this.value);">HomeKO
<input id="rdo_AwayKO" type="radio" value="1" name="Game9Selection" onClick="CalculateTipcode(this.value);">AwayKO
<input type="checkbox" name="Check_DoubleUp" id="Check_DoubleUp">
<label for="Check_DoubleUp">Double Up</label>
Round</p>
<p>TipCode:
<input type="text" name="totalSum" id="totalSum" value="" size="5" readonly="readonly">
</p>
<form name="frm_Submit" method="post" action="">
<label for="Btn_SendTips">Send Tips</label>
<input type="submit" name="Btn_SendTips" id="Btn_SendTips" value="Submit">
</form>
End Sub
Last edited by AussieM8; 27-02-10 at 10:01 PM.
Look Here -> |
Bookmarks