asp_databases thread: Microsoft JET Database Engine error '80040e14' Syntax Error in From Clause
Message #1 by "Robert Sidebotham" <einstein_2005@y...> on Mon, 17 Sep 2001 22:00:26
|
|
Can anybody tell me why this code doesn't work and throws up the following
error message...
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
Here's the code
<% @LANGUAGE="VBSCRIPT" %>
<!--#include virtual="/adovbs.inc"-->
<%
set connAddresses= Server.CreateObject("ADODB.Connection")
set objCommand = Server.CreateObject("ADODB.Command")
connAddresses.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=c:\aspdata\addresses.mdb;"
objCommand.ActiveConnection = connAddresses
' change the next line to your request.form.........
formID=request.form("recordfordelete")
sqltemp="DELETE * FROM sampleTable"
sqltemp=sqltemp & "WHERE FullName='" & formID & "'"
objCommand.CommandText = sqltemp
objCommand.CommandType = adCmdTable
objCommand.Execute
connAddresses.close
set connAddresses=Nothing
set objCommand=Nothing
Message #2 by Jack_Speranza <jsperanza@g...> on Mon, 17 Sep 2001 17:17:59 -0400
|
|
The proper SQL syntax for the DELETE function would not require a '*'
-----Original Message-----
From: Robert Sidebotham [mailto:einstein_2005@y...]
Sent: Monday, September 17, 2001 6:00 PM
To: ASP Databases
Subject: [asp_databases] Microsoft JET Database Engine error '80040e14'
Syntax Error in From Clause
Can anybody tell me why this code doesn't work and throws up the following
error message...
Microsoft JET Database Engine error '80040e14'
Syntax error in FROM clause.
Here's the code
<% @LANGUAGE="VBSCRIPT" %>
<!--#include virtual="/adovbs.inc"-->
<%
set connAddresses= Server.CreateObject("ADODB.Connection")
set objCommand = Server.CreateObject("ADODB.Command")
connAddresses.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=c:\aspdata\addresses.mdb;"
objCommand.ActiveConnection = connAddresses
' change the next line to your request.form.........
formID=request.form("recordfordelete")
sqltemp="DELETE * FROM sampleTable"
sqltemp=sqltemp & "WHERE FullName='" & formID & "'"
objCommand.CommandText = sqltemp
objCommand.CommandType = adCmdTable
objCommand.Execute
connAddresses.close
set connAddresses=Nothing
set objCommand=Nothing
Message #3 by "Junaid hasan" <jnd_hsn@h...> on Mon, 17 Sep 2001 16:18:11 -0500
|
|
you dont need a * in your SQL statement
sqltemp="DELETE FROM sampleTable"
try this
good luck
junaid
>From: "Robert Sidebotham" <einstein_2005@y...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Microsoft JET Database Engine error '80040e14'
>Syntax Error in From Clause
>Date: Mon, 17 Sep 2001 22:00:26
>
>Can anybody tell me why this code doesn't work and throws up the following
>error message...
>
>Microsoft JET Database Engine error '80040e14'
>
>Syntax error in FROM clause.
>
>Here's the code
>
><% @LANGUAGE="VBSCRIPT" %>
><!--#include virtual="/adovbs.inc"-->
><%
>set connAddresses= Server.CreateObject("ADODB.Connection")
>set objCommand = Server.CreateObject("ADODB.Command")
>connAddresses.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
>Source=c:\aspdata\addresses.mdb;"
>
>objCommand.ActiveConnection = connAddresses
>' change the next line to your request.form.........
>formID=request.form("recordfordelete")
>sqltemp="DELETE * FROM sampleTable"
>sqltemp=sqltemp & "WHERE FullName='" & formID & "'"
>objCommand.CommandText = sqltemp
>objCommand.CommandType = adCmdTable
>objCommand.Execute
>
>
>connAddresses.close
>set connAddresses=Nothing
>set objCommand=Nothing
>
Message #4 by Brooks_Piggott@D... on Mon, 17 Sep 2001 16:35:06 -0500
|
|
The problem is there is a space missing between the tablename and the WHERE
keyword.
You SQL statement will look like this:
DELETE * FROM sampleTableWHERE FullName='id'
It *should* be:
sqltemp="DELETE * FROM sampleTable"
sqltemp=sqltemp & " WHERE FullName='" & formID & "'"
'------------------^ inserted space here
-----Original Message-----
From: Junaid hasan [mailto:jnd_hsn@h...]
Sent: Monday, September 17, 2001 4:18 PM
To: ASP Databases
Subject: [asp_databases] Re: Microsoft JET Database Engine error
'80040e14' Syntax Error in From Clause
you dont need a * in your SQL statement
sqltemp="DELETE FROM sampleTable"
try this
good luck
junaid
>From: "Robert Sidebotham" <einstein_2005@y...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Microsoft JET Database Engine error '80040e14'
>Syntax Error in From Clause
>Date: Mon, 17 Sep 2001 22:00:26
>
>Can anybody tell me why this code doesn't work and throws up the following
>error message...
>
>Microsoft JET Database Engine error '80040e14'
>
>Syntax error in FROM clause.
>
>Here's the code
>
><% @LANGUAGE="VBSCRIPT" %>
><!--#include virtual="/adovbs.inc"-->
><%
>set connAddresses= Server.CreateObject("ADODB.Connection")
>set objCommand = Server.CreateObject("ADODB.Command")
>connAddresses.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
>Source=c:\aspdata\addresses.mdb;"
>
>objCommand.ActiveConnection = connAddresses
>' change the next line to your request.form.........
>formID=request.form("recordfordelete")
>sqltemp="DELETE * FROM sampleTable"
>sqltemp=sqltemp & "WHERE FullName='" & formID & "'"
>objCommand.CommandText = sqltemp
>objCommand.CommandType = adCmdTable
>objCommand.Execute
>
>
>connAddresses.close
>set connAddresses=Nothing
>set objCommand=Nothing
>
Message #5 by David Cameron <dcameron@i...> on Tue, 18 Sep 2001 09:42:31 +1000
|
|
There was a space missing, however you have added the * back in. So the
*correct* SQL statement should be:
sqltemp = "DELETE FROM sampleTable"
sqltemp=sqltemp & " WHERE FullName = '" & formID & "'"
Also you can overflow onto a new line using _:
sqltemp = "DELETE FROM sampleTable " & _
"WHERE FullName = '" & formID & "'"
regards
David Cameron
nOw.b2b
dcameron@i...
-----Original Message-----
From: Brooks_Piggott@D... [mailto:Brooks_Piggott@D...]
Sent: Tuesday, 18 September 2001 7:35 AM
To: ASP Databases
Cc: einstein_2005@y...
Subject: [asp_databases] Re: Microsoft JET Database Engine error '8004
0e14' Syntax Error in From Clause
The problem is there is a space missing between the tablename and the WHERE
keyword.
You SQL statement will look like this:
DELETE * FROM sampleTableWHERE FullName='id'
It *should* be:
sqltemp="DELETE * FROM sampleTable"
sqltemp=sqltemp & " WHERE FullName='" & formID & "'"
'------------------^ inserted space here
|