Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: Why does the SQL show error?

    The error says:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

    /wheelofgod/kjvresp2.asp, line 87
    Line 87 is:
    Code:
    rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
    found in:
    Code:
    <% 'Option Explicit%>
    <!--#include file="biblepagetop.txt"-->
    <%
    'Response.Buffer=false
    
    ' Mode contstants
    Const MODE_DEFAULT  = 1
    Const MODE_RESULTS  = 2
    
    Const DB_NAME           = "kjv.mdb" ' Name of our database file
    Const SCRIPT_NAME       = "kjv2.asp"  ' Name of this script
    Const SCRIPT_NAMES      = "kjvresp2.asp"
    const SCRIPT_SAVED      = "saved.asp"
    Const SCRIPT_FEEDBACK   = "mailto.asp"
    Const SCRIPT_TEXT       = "bibletext.asp"
    
    Const RECORDS_PER_PAGE  = 5            ' Number of records per page
    
    Const adOpenForwardOnly = 0
    Const adLockReadOnly = 1
    Const adCmdTableDirect = &H0200
    Const adUseClient = 3
    
    Dim nMode   ' Current Mode 
    ' Find out what mode we are in
    nMode = CLng(Request.QueryString("Mode"))
    
    ' Depending on our mode we will do different things
    Select Case nMode
        
        Case MODE_RESULTS
            ' This is where all the results will show       
            call ShowResults()
    
        Case Else   ' This one is for MODE_DEFAULT or invalid modes all the same
            ' By default display the search form
            call ShowSearchForm()
    End Select
    
    Private Function GetConnectionString()
        GetConnectionString =   "Driver={Microsoft Access Driver (*.mdb)};" & _
                    "DBQ=" & Server.MapPath(DB_NAME) & ";" & _
                    "UID=;PWD=;"
    End Function
    
    Private Sub ShowSearchForm()
        %>
        <!--
            This form will direct user to itself with MODE_RESULTS mode
        -->
        <%
    ' This function will display the results of the search
     call ShowResults()
    End Sub
    %>
    
    <!--#include file="query.asp"-->
    <table border="1" cellspacing="0" cellpadding="0" width="732" style="width:549.0pt;
     border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
     mso-padding-alt:0in 0in 0in 0in">
     <tr style="height:12.75pt">
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">
     <form align="center" method="get" action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select</font><br>
     <select size="1" name="choices" id="choices">
            <option SELECTED VALUE="">None</option> 
            <option VALUE="001">Delete</option>
            <option VALUE="002">Email to:</option>
            <option VALUE="003">Print</option>
            <option VALUE="004">Save in:</option>
     </select><input type="submit" value="OK" name=submit1><br>
    <input type='checkbox' onclick='checkAll(this.form,this)' value="check all" name="ck<%CStr(id)%>">
     <font face="Verdana" color="#FFFFFF">Select All</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book Title</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book #/<br>Book Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Chapter #/<br>Chapter Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Verse #/<br>Verse Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Text</font></th>
      </tr>
    
    <%
        Set rs = Server.CreateObject("ADODB.Recordset")
        
        rs.PageSize = 5
        rs.CacheSize = 5
        rs.CursorLocation = adUseClient
        
        <b>rs.Open SQL, conn, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect</b>
        
    
        If Len(Request("pagenum")) = 0  Then
            rs.AbsolutePage = 1
          Else
            If CInt(Request("pagenum")) <= rs.PageCount Then
                rs.AbsolutePage = Request("pagenum")
              Else
                rs.AbsolutePage = 1
            End If
        End If
        
        Dim abspage, pagecnt
          abspage = rs.AbsolutePage
          pagecnt = rs.PageCount
        If rs.EOF Then
          Response.Write "No records found!"
        Else
          Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
          Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf
          
            Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf
            
            Dim fldF
            
            Response.Write "<table border=1 align=center cellpadding=3 cellspacing=0><thead><tr>"
            'For Each fldF in rs.Fields
            '  Response.Write "<td>" & fldF.Name & "</td>"
            'Next
            'Response.Write "</tr></thead><tbody>"
            
            For intRec=1 To rs.PageSize
              If Not rs.EOF Then
              '  Response.Write "<tr>"
              '  For Each fldF in rs.Fields
              '    Response.Write "<td>" & fldF.Value & "</td>"
              '  Next
              '  Response.Write "<tr>"
    
      rs.MoveFirst
      Count = 0 
      Do while not rs.eof And Count < 10 
    %>
    <%=SQL%>
    <td width="135" nowrap rowspan="2" style="width:101.25pt;border:solid windowtext .5pt;
      border-right:solid windowtext .75pt;padding:.75pt .75pt 0in .75pt;height:
      8.0pt">
    
            <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.txt"
            S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
            <p><input type="checkbox" name="ck<%CStr(id)%> value="<%=rs("id")%>"></p>
    
          <p>&nbsp;
        </td>
        <td width="135" nowrap rowspan="2" style="width:101.25pt;border:solid windowtext .5pt;
      border-right:solid windowtext .75pt;padding:.75pt .75pt 0in .75pt;height:
      8.0pt">
          <p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:Verdana"><%=rs("book_title")%><o:p>
          </span>
          <td width="149" nowrap style="width:111.75pt;border-top:solid windowtext .5pt;
      border-left:none;border-bottom:solid windowtext .75pt;border-right:solid windowtext .75pt;
      mso-border-left-alt:solid windowtext .75pt;padding:.75pt .75pt 0in .75pt;
      height:8.0pt">
          <p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:Verdana"><%=rs("book")%><o:p>
          </o:p>
          </span></p>
        </td>
        <td width="164" nowrap style="width:123.0pt;border-top:solid windowtext .5pt;
      border-left:none;border-bottom:solid windowtext .75pt;border-right:solid windowtext .75pt;
      mso-border-left-alt:solid windowtext .75pt;padding:.75pt .75pt 0in .75pt;
      height:8.0pt">
          <p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:Verdana"><%=rs("chapter")%><o:p>
          </o:p>
          </span></p>
        </td>
           <td width="151" nowrap style="width:113.25pt;border-top:solid windowtext .5pt;
      border-left:none;border-bottom:solid windowtext .75pt;border-right:solid windowtext .75pt;
      mso-border-left-alt:solid windowtext .75pt;padding:.75pt .75pt 0in .75pt;
      height:8.0pt">
          <p class="MsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:Verdana"><%=rs("verse")%><o:p>
          </o:p>
          </span></p>
        </td>
        <td width="245" nowrap rowspan="2" valign="top" style="mso-border-left-alt: solid windowtext .75pt; height: 12.75pt; border-left-style: none; border-left-width: medium; border-right: .5pt solid windowtext; border-top: .5pt solid windowtext; border-bottom: .5pt solid windowtext; padding-left: .75pt; padding-right: .75pt; padding-top: .75pt; padding-bottom: 0in">
          <p class="MsoNormal"><span style="font-size:10.0pt;font-family:Verdana"><b><%=rs("book_title")%>&nbsp;&nbsp;<%=rs("chap")%>:<%=rs("vers")%></b><br><%=rs("text_data")%><o:p>
          </o:p>
          </span></p>
        </td>
      <tr style="height:8.0pt" ALIGN="middle">
          <td width="10">
          <span>
    <A href="<!--#include file="letters.asp"-->" target="_blank">
    <IMG SRC="hebrew/<%=RS("book_spoke")%>.jpg" ALT="Book&nbsp;Spoke&nbsp;&nbsp;<%=RS("book_spoke")%>">
    </A> 
    
    </span>
        </td>
        <td width="10">
          <span>
    <IMG SRC="hebrew/<%=RS("chapter_spoke")%>.jpg" ALIGN="middle" ALT="Chapter&nbsp;Spoke&nbsp;&nbsp;<%=RS("chapter_spoke")%>">
         
    </span>
        </td>
        <td width="10" ALIGN="middle" >
          <span><IMG SRC="hebrew/<%=RS("verse_spoke")%>.jpg" ALIGN="middle" ALT="Verse&nbsp;Spoke&nbsp;&nbsp;<%=RS("verse_spoke")%>">
          </span>
        </td>
      </tr>
    <% rs.MoveNext
        Loop
    %>
    </form>
    </table>
    <%
                'rs.MoveNext
              End If
            Next
            'Response.Write "</tbody></table><p>"
            
            ' Now showing first, next, back, last buttons.
            Response.Write "<div align=""center"">" & vbcrlf
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=1"">First Page</a>"
            Response.Write "&nbsp;|&nbsp;"
            
            If abspage = 1 Then
            Response.Write "<span style=""color:silver;"">Previous Page</span>"
            Else
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage - 1 & """>Previous Page</a>"
            End If
                    Response.Write "&nbsp;|&nbsp;"
            
            If abspage < pagecnt Then
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & abspage + 1 & """>Next Page</a>"
            Else
            Response.Write "<span style=""color:silver;"">Next Page</span>"
            End If
            Response.Write "&nbsp;|&nbsp;"
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?pagenum=" & pagecnt & """>Last Page</a>"
            Response.Write "</div>" & vbcrlf
            
        rs.Close
        Set rs = Nothing
    End If
    End Sub
    %>
    <!--#include file=biblepagebottom.txt-->
    I tried shortening the length of the code by putting the SQL statement as an Include File:

    <!--#include file="query.asp"-->

  2. #2
    Join Date
    Jul 2004
    Posts
    494

    SQL statement

    The code of <!--#include file="query.asp"--> is:
    Code:
    <%Sub ShowResults()
        Dim conn
        Dim SQL         ' String that will have our SQL statments
        Dim RS          ' Recordset object
        Dim Keyword     ' Keyword for search
    'pageing
        Dim nRecCount   ' Number of records found
        Dim nPageCount  ' Number of pages of records we have
        Dim nPage       ' Current page number
    'query
        Dim iCounter
        Dim iLoopCount
        Dim aRecTypes
        Dim spoke       ' For dropdown
        Dim number
        Dim Keywordb
        Dim Keywordc
        Dim intRec
    
    
        ' define our SQL statement
        ' we will be looking for all the records in tblItem table 
        ' where ItemName contains our Keyword
        ' do not forget to fix tick marks (single quotes) in our Keyword
        SQL = "SELECT * FROM bible WHERE "
        Conn = GetConnectionString()
    
        Keyword = Trim(Request.QueryString("Keyword"))
        spoke = Request.Querystring("spoke")
        number = Request.QueryString("number")
        Keywordb = Request.QueryString("Keywordb")
        Keywordc = Request.QueryString("Keywordc")
    
    Counter = 0
    
    If   request.QueryString("text_data")="yes" then
    
      SQL = SQL & "text_data LIKE '%" & Keyword & "%' AND "  
      SQL = SQL & "text_data LIKE '%" & Keywordb & "%' AND "
      SQL = SQL & "text_data LIKE '%" & Keywordc & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    
    If   request.QueryString("book")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book LIKE '" & number & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    
    If   request.QueryString("book_title")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book_title LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("chapter")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "chapter LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("verse")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "verse LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("book_spoke")="Book_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("chapter_spoke")="Chapter_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "chapter_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("verse_spoke")="Verse_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "verse_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If Trim(Request.QueryString("recordType")) <> "" Then
    
    
      aRecTypes = Split(Request.QueryString("recordType"), ",")
    
      If IsArray(aRecTypes) Then 'This is a bit redundant, but it can't hurt
        SQL = SQL & " AND ("
    
        For iLoopCount = 0 To UBound(aRecTypes)
          If iLoopCount <> 0 Then
            SQL = SQL & " OR "
          End If
    
          SQL = SQL & " recordType = '" & trim(aRecTypes(iLoopCount)) & "'"
        Next
      End If
      SQL = SQL & ")"
    End If%>
    I hope you have the patience to read it through or show me if there is any way to simplify it further.

    Is it a good idea to leave the SQL as a separate file?

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    okie, I've read though most of this... but can you make it a little easier one us and get the page to write out the sql that it is trying to execute against the database rather then us trying to look for a hole in the building of the sql string?

  4. #4
    Join Date
    Jul 2004
    Posts
    494

    Sql

    SELECT * FROM bible WHERE text_data LIKE '%artaxerxes%' AND text_data LIKE '%%' AND text_data LIKE '%%'
    I don't see anything wrong with it. I have 3 textboxes which may or may not be filled.

  5. #5
    Join Date
    Jul 2004
    Posts
    494

    Sql

    SELECT * FROM bible WHERE text_data LIKE '%artaxerxes%' AND text_data LIKE '%%' AND text_data LIKE '%%'
    I don't see anything wrong with it. I have 3 textboxes which may or may not be filled.

  6. #6
    Join Date
    Jul 2004
    Posts
    494

    Sql

    SELECT * FROM bible WHERE text_data LIKE '%artaxerxes%' AND text_data LIKE '%%' AND text_data LIKE '%%'
    I don't see anything wrong with it. I have 3 textboxes which may or may not be filled.

  7. #7
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    To be honest I can't really see anything wrong with it either unless it is getting upset about the '%%' values.....

  8. #8
    Join Date
    Jul 2004
    Posts
    494
    I wonder if the BOF and EOF along with the while are written correctly. Can you explain the procedure?
    Once pasted the query back in the page (instead of file-including) it worked

  9. #9
    Join Date
    Jul 2004
    Posts
    494

    ok

    I changed the coding but same error came:
    Code:
    <% 'Option Explicit
    Response.Buffer=false%>
    <!--#include file="biblepagetop.txt"-->
    <%
    ' Mode contstants
    Const MODE_DEFAULT  = 1
    Const MODE_RESULTS  = 2
    
    Const DB_NAME           = "kjv.mdb" ' Name of our database file
    Const SCRIPT_NAME       = "kjv2.asp"  ' Name of this script
    Const SCRIPT_NAMES      = "kjvresp2.asp"
    const SCRIPT_SAVED      = "saved.asp"
    Const SCRIPT_FEEDBACK   = "mailto.asp"
    Const SCRIPT_TEXT       = "bibletext.asp"
    
    Const RECORDS_PER_PAGE  = 5            ' Number of records per page
    
    Const adOpenForwardOnly = 0
    Const adLockReadOnly = 1
    Const adCmdTableDirect = &H0200
    Const adUseClient = 3
    
    Dim nMode   ' Current Mode 
    ' Find out what mode we are in
    nMode = CLng(Request.QueryString("Mode"))
    
    ' Depending on our mode we will do different things
    Select Case nMode
        
        Case MODE_RESULTS
            ' This is where all the results will show       
            call ShowResults()
    
        Case Else   ' This one is for MODE_DEFAULT or invalid modes all the same
            ' By default display the search form
            call ShowSearchForm()
    End Select
    
    Private Function GetConnectionString()
        GetConnectionString =   "Driver={Microsoft Access Driver (*.mdb)};" & _
                    "DBQ=" & Server.MapPath(DB_NAME) & ";" & _
                    "UID=;PWD=;"
    End Function
    
    Private Sub ShowSearchForm()
        %>
        <!--
            This form will direct user to itself with MODE_RESULTS mode
        -->
        <%
    ' This function will display the results of the search
     call ShowResults()
    End Sub
    
    Sub ShowResults()
        Dim strConn     ' Database connection string
        Dim SQL         ' String that will have our SQL statments
        Dim RS          ' Recordset object
        Dim Keyword     ' Keyword for search
    'pageing
        Dim nRecCount   ' Number of records found
        Dim nPageCount  ' Number of pages of records we have
        Dim nPage       ' Current page number
    'query
        Dim iCounter
        Dim iLoopCount
        Dim aRecTypes
        Dim spoke       ' For dropdown
        Dim number
        Dim Keywordb
        Dim Keywordc
        Dim intRec
    
    
        ' define our SQL statement
        ' we will be looking for all the records in tblItem table 
        ' where ItemName contains our Keyword
        ' do not forget to fix tick marks (single quotes) in our Keyword
        SQL = "SELECT * FROM bible WHERE "
        strConn = GetConnectionString()
    
        ' Let's see what page are we looking at right now
        nPage = CLng(Request.QueryString("Page"))
    
        ' Let's see what user wants to search for today :)
        Keyword = Trim(Request.QueryString("Keyword"))
        spoke = Request.Querystring("spoke")
        number = Request.QueryString("number")
        Keywordb = Request.QueryString("Keywordb")
        Keywordc = Request.QueryString("Keywordc")
    
    'Set conn = Server.CreateObject("ADODB.Connection")  
    'conn.Open(GetConnectionString)              
    
    iCounter = 0
    
    If   request.QueryString("text_data")="yes" then
    
      SQL = SQL & "text_data LIKE '%" & Keyword & "%' AND "  
      SQL = SQL & "text_data LIKE '%" & Keywordb & "%' AND "
      SQL = SQL & "text_data LIKE '%" & Keywordc & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    
    If   request.QueryString("book")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book LIKE '" & number & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    
    If   request.QueryString("book_title")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book_title LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("chapter")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "chapter LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("verse")="yes" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "verse LIKE '%" & number & "%'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("book_spoke")="Book_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "book_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("chapter_spoke")="Chapter_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "chapter_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If   request.QueryString("verse_spoke")="Verse_Spoke" then
    
      If iCounter > 0 Then
        SQL = SQL & " AND "
      End If
    
      SQL = SQL & "verse_spoke = '" & spoke & "'"
    
      iCounter = iCounter + 1
    
    end if
    
    If Trim(Request.QueryString("recordType")) <> "" Then
    
    
      aRecTypes = Split(Request.QueryString("recordType"), ",")
    
      If IsArray(aRecTypes) Then 'This is a bit redundant, but it can't hurt
        SQL = SQL & " AND ("
    
        For iLoopCount = 0 To UBound(aRecTypes)
          If iLoopCount <> 0 Then
            SQL = SQL & " OR "
          End If
    
          SQL = SQL & " recordType = '" & trim(aRecTypes(iLoopCount)) & "'"
        Next
      End If
      SQL = SQL & ")"
    End If
    
        Set rs = Server.CreateObject("ADODB.Recordset")
        
        rs.PageSize = 5
        rs.CacheSize = 5
        rs.CursorLocation = adUseClient
        Response.Write SQL
        rs.Open SQL, StrConn, adOpenForwardOnly, adLockReadOnly, adCmdTableDirect
        
    
        If Len(Request("pagenum")) = 0  Then
            rs.AbsolutePage = 1
          Else
            If CInt(Request("pagenum")) <= rs.PageCount Then
                rs.AbsolutePage = Request("pagenum")
              Else
                rs.AbsolutePage = 1
            End If
        End If
        
        Dim abspage, pagecnt
          abspage = rs.AbsolutePage
          pagecnt = rs.PageCount
    
        If rs.BOF and rs.EOF Then
          Response.Write "No records found!"
        Else
          Response.Write "PageCount : " & rs.PageCount & "<br>" & vbcrlf
          Response.Write "Absolute Page : " & rs.AbsolutePage & "<br>" & vbcrlf
          Response.Write "Total number of records : " & rs.RecordCount & "<br><br>" & vbcrlf
    %>
    <table>
     <tr>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">
     <form align="center" method="get" action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select</font><br>
     <select size="1" name="choices" id="choices">
            <option SELECTED VALUE="">None</option> 
            <option VALUE="001">Delete</option>
            <option VALUE="002">Email to:</option>
            <option VALUE="003">Print</option>
            <option VALUE="004">Save in:</option>
     </select><input type="submit" value="OK" name=submit1><br>
    <input type='checkbox' onclick='checkAll(this.form,this)' value="check all" name="ck<%CStr(id)%>">
     <font face="Verdana" color="#FFFFFF">Select All</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book Title</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Book #/<br>Book Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Chapter #/<br>Chapter Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Verse #/<br>Verse Spoke</font></th>
     <th bgcolor="#800000"><font face="Verdana" color="#FFFFFF">Text</font></th>
      </tr>
    <%
      rs.MoveFirst
      Count = 0 
      Do while not rs.eof And Count < 10 
    %>
    <td>
    
            <p><input type="checkbox" name="ck<%CStr(id)%> value="<%=rs("id")%>"></p>
    
          <p> 
        </td>
        <td>
          <p><span><%=rs("book_title")%><o:p>
          </span>
          <td>
          <p><span><%=rs("book")%><o:p>
          </o:p>
          </span></p>
        </td>
        <td>
          <p><span><%=rs("chapter")%><o:p>
          </o:p>
          </span></p>
        </td>
           <td>
          <p><span><%=rs("verse")%><o:p>
          </o:p>
          </span></p>
        </td>
        <td>
          <p><span><b><%=rs("book_title")%>  <%=rs("chap")%>:<%=rs("vers")%></b><br><%=rs("text_data")%><o:p>
          </o:p>
          </span></p>
        </td>
      <tr>
          <td width="10">
          <span>
    <A href="<!--#include file="letters.asp"-->" target="_blank">
    <IMG SRC="hebrew/<%=RS("book_spoke")%>.jpg" ALT="Book Spoke  <%=RS("book_spoke")%>">
    </A> 
    </span>
        </td>
        <td>
          <span>
    <IMG SRC="hebrew/<%=RS("chapter_spoke")%>.jpg" ALIGN="middle" ALT="Chapter Spoke  <%=RS("chapter_spoke")%>">
         
    </span>
        </td>
        <td>
          <span><IMG SRC="hebrew/<%=RS("verse_spoke")%>.jpg" ALIGN="middle" ALT="Verse Spoke  <%=RS("verse_spoke")%>">
          </span>
        </td>
      </tr>
    <% rs.MoveNext
        Loop
    %>
    </form>
    </table>
    <%
            ' Now showing first, next, back, last buttons.
            Response.Write "<div align=""center"">" & vbcrlf
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?pagenum=1"">First Page</a>"
            Response.Write " | "
            
            If abspage = 1 Then
            Response.Write "<span style=""color:silver;"">Previous Page</span>"
            Else
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?pagenum=" & abspage - 1 & """>Previous Page</a>"
            End If
                    Response.Write " | "
            
            If abspage < pagecnt Then
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?pagenum=" & abspage + 1 & """>Next Page</a>"
            Else
            Response.Write "<span style=""color:silver;"">Next Page</span>"
            End If
            Response.Write " | "
            Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAMES") & "?pagenum=" & pagecnt & """>Last Page</a>"
            Response.Write "</div>" & vbcrlf
    %>
    <!--#include file=biblepagebottom.txt-->
    <%        
        rs.Close
        Set rs = Nothing
    End If
    End Sub
    %>
    Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.

    /wheelofgod/kjvresp2.asp, line 218

  10. #10
    Join Date
    Jul 2004
    Posts
    494
    The reason why this might've occured is probably because I used:
    http://www.stardeveloper.com/article...0071001&page=1
    Because I liked the "pageing". But I don't understand why it shouldn't work!

  11. #11
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I suggest you change this
    Code:
    If   request.QueryString("text_data")="yes" then
    
      SQL = SQL & "text_data LIKE '%" & Keyword & "%' AND "  
      SQL = SQL & "text_data LIKE '%" & Keywordb & "%' AND "
      SQL = SQL & "text_data LIKE '%" & Keywordc & "%'"
    
      iCounter = iCounter + 1
    
    end if
    to this...
    Code:
    If   request.QueryString("text_data")="yes" then
    
      if Keyword <> "" then 
        SQL = SQL & "text_data LIKE '%" & Keyword & "%' AND "  
      end if
    
      if Keywordb <> "" then 
        SQL = SQL & "text_data LIKE '%" & Keywordb & "%' AND "
      end if
    
      if Keywordc <> "" then 
        SQL = SQL & "text_data LIKE '%" & Keywordc & "%'"
      end if
    
      iCounter = iCounter + 1
    
    end if
    and see if your problem goes away

  12. #12
    Join Date
    Jul 2004
    Posts
    494

    ok

    I had tried it by removing all the possible extensions and leave SQL="SELECT * FROM bible " and it still didn't work.

  13. #13
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    in that case I would suggest that your sql string is not what you think it is.

Posting Permissions

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