Results 1 to 2 of 2

Thread: What's wrong with my ASP code?

  1. #1
    Senior Member
    Join Date
    Jan 2008
    Posts
    636
    Thanks
    79
    Thanked 23 Times in 20 Posts
    Rep Power
    223
    Reputation
    171

    Default What's wrong with my ASP code?

    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 ->
  • #2
    Senior Member
    Join Date
    Jan 2008
    Posts
    636
    Thanks
    79
    Thanked 23 Times in 20 Posts
    Rep Power
    223
    Reputation
    171

    Default

    Quote Originally Posted by AussieM8 View Post

    Found the problem ... it was in the last 'End Sub' text.

    I neglected to put in back into ASP code, so should have been ...

    </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%>
    Thought I would post back the solution if anyone else had similar issues.

  • Similar Threads

    1. dunno what when wrong... :(
      By tommi in forum Newbie Satellite
      Replies: 4
      Last Post: 11-05-09, 05:35 PM
    2. OK! So what am I doing wrong?
      By ufosarereal in forum Newbie Satellite
      Replies: 39
      Last Post: 18-01-09, 07:58 PM
    3. F***ING painfull what am i doing wrong??
      By nathj in forum Newbie Satellite
      Replies: 23
      Last Post: 20-11-08, 11:45 PM
    4. what has gone wrong?
      By mate in forum Satellite TV General
      Replies: 2
      Last Post: 30-06-08, 09:37 PM
    5. something gone wrong
      By MAKEDONIJA in forum Support Ticket System
      Replies: 2
      Last Post: 14-03-08, 12:17 AM

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •