473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Jet Database Error

Here is the message I get when I clink on the link. I did write the
code so I'm not sure what got deleted. Please Help!

ERROR:
Click on the sermon title to view it, or click the edit link to edit
the content, or the delete link to delete the sermon.

Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'SermonDate
DESCENDING'.

/sermonlist.asp, line 37

CODE:
<%
Option Explicit
Response.Buffer = True

If Session("User") = "" then
Session("FromPage") = "sermonlist.asp"
Response.Redirect("Login.asp")
End If
dim cn, cmd, rs, DataPath, strSQL, TxtClr
Response.Write("<html><head><title>Sermons</title></head><body><br><br>")
Response.Write("<center>Click on the sermon title to view it, or click
the edit link to edit the content, or the delete link to delete the
sermon.</center><br><br>")

DataPath = Server.MapPath("Calvary.mdb")

DataPath = Replace(DataPath, "wwwroot", "Database")
DataPath = Replace(DataPath, "\", "/")
set cn = CreateObject("ADODB.Connection")
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.ConnectionTimeout = 40
cn.Open DataPath

set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = cn

set rs = CreateObject("ADODB.RecordSet")

strSQL = "Select * From Sermons Order By SermonDate DESCENDING"

cmd.CommandText = strSQL

set rs = cmd.execute
Response.Write("<table cellspacing='2' cellpadding = '3' align =
'center'>")
Response.Write("<tr><th>Sermon Title</th><th>Sermon Date</th><th>Pastor
Name</th><th>Edit</th><th>Delete</th></tr>")

TxtClr = "#FFFFFF"

Do While (Not rs.eof)

If TxtClr = "#FFFFFF" Then
TxtClr = "#CCCCCC"
Else
TxtClr = "#FFFFFF"
End If

Response.Write("<tr bgcolor = " & TxtClr & "><td><a
href='view.asp?Name=" & Server.urlencode(rs("SermonTitle")) & "'>" &
rs("SermonTitle") & "</a></td")
Response.Write("<td>" & rs("SermonDate") & "</td>")
Response.Write("<td>" & rs("PastorName") & "</td>")
Response.Write("<td><a href='edit_sermon.asp?Name=" &
server.urlencode(rs("SermonTitle")) & "'>Edit</a></td>")
Response.Write("<td><a href='delete.asp?Name=" & server.urlencode(
rs("SermonTitle")) & "'>Delete</a></td></tr>")
rs.MoveNext
Loop

Response.Write("</table></body></html>")

rs.close
set rs = nothing
set cmd = nothing
cn.close
set cn = nothing

%>

Oct 4 '06 #1
4 1277
<pc****@gmail.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
Here is the message I get when I clink on the link. I did write the
code so I'm not sure what got deleted. Please Help!

ERROR:
Click on the sermon title to view it, or click the edit link to edit
the content, or the delete link to delete the sermon.

Microsoft JET Database Engine error '80040e14'

Syntax error (missing operator) in query expression 'SermonDate
DESCENDING'.

/sermonlist.asp, line 37
[snip]

You didn't tell us what database and version your using!

However, try changing "DESCENDING" to "DESC".

SQL ORDER BY
http://www.w3schools.com/sql/sql_orderby.asp
Oct 4 '06 #2
Try ORDER BY SermonDate DESC ... sounds like JET doesn't like the full word.

Neither does SQL Server, by the way:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'DESCENDING'.

Where did you find documentation that DESCENDING was a valid operator?


strSQL = "Select * From Sermons Order By SermonDate DESCENDING"

Oct 4 '06 #3
"McKirahan" <Ne**@McKirahan.comwrote in message
news:xa******************************@comcast.com. ..
You didn't tell us what database and version your using!
Sorry, didn't see the ".mdb" as it was after DESCENDING...
Oct 4 '06 #4

McKirahan wrote:
"McKirahan" <Ne**@McKirahan.comwrote in message
news:xa******************************@comcast.com. ..
You didn't tell us what database and version your using!

Sorry, didn't see the ".mdb" as it was after DESCENDING...


Thanks DESC fixed it!

Oct 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
6
by: Marvin Libson | last post by:
Hi All: I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I have created a java UDF and trigger. When I update my database I get the following error: SQL1224N A database...
1
by: pintur | last post by:
The message is: SQL1036C Errore di I/O durante l' accesso al database. SQLSTATE=58030 what is the proble? what for restore tables? thanks
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
0
by: Jonathan Wood | last post by:
I seem to be having errors creating and accessing an SQL database. Unfortunatley, I am brand new to SQL setup and administration issues so this really is not my area of expertise. I know I had...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
12
by: Steve | last post by:
I have a database that raises an error when you try to open it and it doesn't open. Trying to open the database with the OpenDatabase method raises the same error. Trying to import any objects...
2
by: Scott Jones | last post by:
Hello, In an attempt to save disk space, I went in and gzipped all of the log files for my database running DB2 version 7.2 . This resulted in the database being marked bad because a log file...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.