 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 14th, 2004, 02:17 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Why does the SQL show error?
The error says:
Quote:
quote:
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%>
<%
'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
%>
<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">
<form align="center" method="get" action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select<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)%>">
Select All</th>
<th bgcolor="#800000">Book Title</th>
<th bgcolor="#800000">Book #/<br>Book Spoke</th>
<th bgcolor="#800000">Chapter #/<br>Chapter Spoke</th>
<th bgcolor="#800000">Verse #/<br>Verse Spoke</th>
<th bgcolor="#800000">Text</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>
</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")%> <%=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="" target="_blank">
<IMG SRC="hebrew/<%=RS("book_spoke")%>.jpg" ALT="Book Spoke <%=RS("book_spoke")%>">
</A>
</span>
</td>
<td width="10">
<span>
<IMG SRC="hebrew/<%=RS("chapter_spoke")%>.jpg" ALIGN="middle" ALT="Chapter Spoke <%=RS("chapter_spoke")%>">
</span>
</td>
<td width="10" ALIGN="middle" >
<span><IMG SRC="hebrew/<%=RS("verse_spoke")%>.jpg" ALIGN="middle" ALT="Verse Spoke <%=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 " | "
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 " | "
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 " | "
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
%>
I tried shortening the length of the code by putting the SQL statement as an Include File:
|
|

October 14th, 2004, 02:21 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
SQL statement
The code of 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?
|
|

October 14th, 2004, 03:34 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
If you are duplicating the SQL query throughout the app, I would separate it out. Otherwise, if 1 time only deal, leave it in. Do this though to check if you are having an error:
Add the following code after the last End If in the 2nd post:
'Write the SQL to screen so you can see what it is generating; one of the fields is probably missing
Response.Write(SQL)
'End the respnonse after this output; page finished processing; MUST REMOVE LATER for page to work
Response.End
Post the results.
Brian
|
|

October 14th, 2004, 10:12 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
SELECT * FROM bible WHERE text_data LIKE '%artaxerxes%' AND text_data LIKE '%%' AND text_data LIKE '%%'
|
|

October 15th, 2004, 07:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Do you need these additional fields:
AND text_data LIKE '%%' AND text_data LIKE '%%'
I don't think this is your problem, but it isn't necessary. I don't see anything wrong with the syntax. Is the table spelled exactly right?
Brian
|
|

October 15th, 2004, 07:17 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Also try copying/pasting the query into an Access query and run it there, see if an error is returned.
Brian
|
|

October 15th, 2004, 03:38 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I wonder if the BOF and EOF along with the while are written correctly. Can you explain the procedure?
|
|

October 15th, 2004, 03:58 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Once pasted the query back in the page (instead of file-including) it worked
|
|

October 15th, 2004, 05:46 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I changed the coding but same error came:
Code:
<% 'Option Explicit
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
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">
<form align="center" method="get" action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select<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)%>">
Select All</th>
<th bgcolor="#800000">Book Title</th>
<th bgcolor="#800000">Book #/<br>Book Spoke</th>
<th bgcolor="#800000">Chapter #/<br>Chapter Spoke</th>
<th bgcolor="#800000">Verse #/<br>Verse Spoke</th>
<th bgcolor="#800000">Text</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="" 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
%>
<%
rs.Close
Set rs = Nothing
End If
End Sub
%>
Quote:
quote:
Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/wheelofgod/kjvresp2.asp, line 218
|
|
|

October 16th, 2004, 01:02 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
As it shows
Quote:
quote:Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/wheelofgod/kjvresp2.asp, line 218
|
it is enough that you check the syntax or post the code that is related to the line number 218 or post the sql query that you construct within your ASP code, rather than posting a whole lot of code here, that lets the visitors to skip this post. This post/page itself looks so wide for anyone to scroll right and left to understand what is going on in this.
_________________________
- Vijay G
Strive for Perfection
|
|
 |