POLL script with SQL server 7.0

Results 1 to 2 of 2

Thread: POLL script with SQL server 7.0

  1. #1
    Join Date
    Dec 1969

    Default POLL script with SQL server 7.0

    I get the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR>[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near &#039#&#039. <BR><BR>/bctest/poll.asp, line 19<BR><BR>What is wrong with my code ?<BR><BR>Code:<BR><BR>&#060;%<BR> Const iWidth = 150<BR> Dim objConn, objRS, strVoted, strSQL <BR> <BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "bctestdb","sa",""<BR> Set Session("MyDB_conn") = objConn<BR> <BR> &#039Create our recordset object<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> &#039Determine if this person has already voted today...<BR> strVoted = Request.Cookies("Voted")<BR> <BR> strSQL = "SELECT PollOption.PollOptionID, PollOption.QuestionText, Poll.PollQuestion " & _<BR> "FROM Poll INNER JOIN PollOption ON Poll.PollID = PollOption.PollID " & _<BR> "WHERE Poll.DateStart &#060;= #" & Date & "# AND Poll.DateEnd &#062;= #" & Date & "#;"<BR> <BR> &#039objRS.Open strSQL, objConn<BR> Set objRS = objConn.Execute(strSQL)<BR>%&#062;<BR>

  2. #2
    Steve M Guest

    Default RE: POLL script with SQL server 7.0

    Sounds like a database that doesn&#039t accept Access syntax. Try changing the # to single quote and remove the semicolon. You may also want to do the join with standard SQL instead of the &#039INNER JOIN&#039 syntax. It helps to run the same query through an ad-hoc query tool for the database, or a &#039Pass-Thru&#039 query with Access, and verify that it works there.

Posting Permissions

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