error with user poll

Results 1 to 6 of 6

Thread: error with user poll

  1. #1
    kassim Guest

    Default error with user poll

    This is the error I get when I run the poll:<BR><BR>Microsoft VBScript compilation error &#039 800a0400&#039 <BR><BR>Expected statement <BR><BR>/pollResults.asp, line 7 <BR><BR>Option Explicit<BR>^<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    118

    Default RE: error with user poll

    I dont know whether you have put &#060;% %&#062; between your scripts. If not try this.

  3. #3
    kassim Guest

    Default RE: error with user poll

    Sorry, I&#039m very new to ASP. Here take a look at the script:<BR><BR>&#060;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&#062;<BR><BR>&#060;html&#062;<BR>&#060;head&#0 62;<BR>&#060;%<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;%<BR> Response.ExpiresAbsolute = Now() - 1<BR><BR> &#039All we want to do here is increment the vote count for the voting option<BR> &#039selected...<BR><BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _<BR> Server.MapPath("poll1.mdb") & ";"<BR> objConn.Open<BR><BR> &#039Read in our variables<BR> Dim iPollOptionID<BR> iPollOptionID = CInt(Request("radPoll"))<BR> <BR><BR> objConn.Execute "UPDATE PollOption SET Votes = Votes + 1 " & _<BR> "WHERE PollOptionID = " & iPollOptionID<BR><BR> <BR> objConn.Close<BR> Set objConn = Nothing<BR> <BR> &#039We&#039ve gotta write a cookie<BR> Response.Cookies("Voted") = "Yes"<BR> Response.Cookies("Voted").Expires = DateAdd("d",1,Date)<BR> &#039Response.Cookies("Voted").Domain = ".t-smitch"<BR> Response.Cookies("Voted").Path = "/poll" <BR> <BR> &#039Send the user back to the previous page<BR> Response.Redirect Request("URLFrom")<BR>%&#062;<BR><BR>&#060;title&# 062;Untitled&#060;/title&#062;<BR><BR><BR>&#060;/head&#062;<BR><BR>&#060;body&#062;<BR><BR><BR><BR> &#060;/body&#062;<BR>&#060;/html&#062;

  4. #4
    Vivek Nama Guest

    Default Found Error

    &#060;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&#062;<BR><BR>&#060;html&#062;<BR>&#060;head&#0 62;<BR>&#060;% ------- not required -- UNFINISHED %&#062; SIGN <BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;


  5. #5
    kassim Guest

    Default RE: Found Error

    I still get the following error:<BR><BR>Microsoft VBScript compilation error &#039 800a0400&#039 <BR><BR>Expected statement <BR><BR>/pollResults.asp, line 7 <BR><BR>Option Explicit<BR>^<BR><BR><BR>Here is the code:<BR><BR>&#060;head&#062;<BR>&#060;title&#062; Untitled&#060;/title&#062;<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>&#060;%<BR> Response.ExpiresAbsolute = Now() - 1<BR><BR> &#039All we want to do here is increment the vote count for the voting option<BR> &#039selected...<BR><BR> Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _<BR> Server.MapPath("poll1.mdb") & ";"<BR> objConn.Open<BR><BR> &#039Read in our variables<BR> Dim iPollOptionID<BR> iPollOptionID = CInt(Request("radPoll"))<BR> <BR><BR> objConn.Execute "UPDATE PollOption SET Votes = Votes + 1 " & _<BR> "WHERE PollOptionID = " & iPollOptionID<BR><BR> <BR> objConn.Close<BR> Set objConn = Nothing<BR> <BR> &#039We&#039ve gotta write a cookie<BR> Response.Cookies("Voted") = "Yes"<BR> Response.Cookies("Voted").Expires = DateAdd("d",1,Date)<BR> &#039Response.Cookies("Voted").Domain = ".t-smitch"<BR> Response.Cookies("Voted").Path = "/poll" <BR> <BR> &#039Send the user back to the previous page<BR> Response.Redirect Request("URLFrom")<BR>%&#062;<BR>&#060;/head&#062;

  6. #6
    Join Date
    Dec 1969
    Posts
    4

    Default RE: Found Error

    Try to move <BR><BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;% Option Explicit %&#062;<BR>to the very first line of the code.

Posting Permissions

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