|
 |
asp_databases thread: Syntax error in UPDATE Statement?
Message #1 by "Jeffrey Ciesla" <JCiesla@o...> on Wed, 03 May 2000 11:18:21 -0400
|
|
This is a MIME message. If you are reading this text, you may want to
consider changing to a mail reader or gateway that understands how to
properly handle MIME multipart messages.
--=_2D75092F.C4A5CBF6
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
Here is the Update statement. ProjectNotes is the table in the database.
UPDATE ProjectNotes
SET
ProjectNo=3D'::ProjectNo::',
NoteNo=3D'::NoteNo::',
Level=3D'::Level::',
Note=3D'::Note::'
WHERE NoteNo=3D::NoteNo
All of the fields are there, I just can't figure out why I get the error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147217900 (0x80040e14)
Jeffrey P. Ciesla
Information Technology
Oglebay Norton Company
http://www.oglebaynorton.com
Message #2 by Milne William-wmilne01 <wmilne01@e...> on Wed, 3 May 2000 17:35:38 +0100
|
|
Jeffrey
I vaguely remember a similar problem with an ODBC Access database. Is there
a primary key on the table ?
Willie Milne
-----Original Message-----
From: Jeffrey Ciesla
Sent: 03 May 2000 16:18
To: ASP Databases
Subject: [asp_databases] Syntax error in UPDATE Statement?
Here is the Update statement. ProjectNotes is the table in the database.
UPDATE ProjectNotes
SET
ProjectNo='::ProjectNo::',
NoteNo='::NoteNo::',
Level='::Level::',
Note='::Note::'
WHERE NoteNo=::NoteNo
All of the fields are there, I just can't figure out why I get the error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147217900 (0x80040e14)
Jeffrey P. Ciesla
Information Technology
Oglebay Norton Company
http://www.oglebaynorton.com <http://www.oglebaynorton.com>
Message #3 by "Morrow, Jeff" <jmorrow@u...> on Wed, 3 May 2000 13:42:40 -0500
|
|
Do you have SQL Query Analyzer( it is part of the client utilities for SQL
Server)? If so, build your Update statement in the Query Analyzer to make
sure it works, then adapt it for use in your .asp page, that's always worked
for me anyway.
-----Original Message-----
From: Jeffrey Ciesla
Sent: Wednesday, May 03, 2000 10:18 AM
To: ASP Databases
Subject: [asp_databases] Syntax error in UPDATE Statement?
Here is the Update statement. ProjectNotes is the table in the database.
UPDATE ProjectNotes
SET
ProjectNo='::ProjectNo::',
NoteNo='::NoteNo::',
Level='::Level::',
Note='::Note::'
WHERE NoteNo=::NoteNo
All of the fields are there, I just can't figure out why I get the error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147217900 (0x80040e14)
Jeffrey P. Ciesla
Information Technology
Oglebay Norton Company
http://www.oglebaynorton.com <http://www.oglebaynorton.com>
Message #4 by "Ken Schaefer" <ken.s@a...> on Thu, 4 May 2000 15:25:13 +1000
|
|
I don't know if this is just an encoding problem, but in my email program I
see all these colons in your SQL statement.
You don't need those...
UPDATE ProjectNotes SET ProjectNo='" & ProjectNo & "' etc...
Also, if you're using variables in ASP, you need to put "SELECT ...." &
varVariable & " ...more SELECT"
to put the variables into the SQL string.
Also, for numeric fields, you don't need to put ' around the values, eg I
assume that ProjectNo is a numeric field, in which case do:
UPDATE ProjectNotes SET ProjectNo = " & ProjectNo & "
HTH
Cheers
Ken
----- Original Message -----
From: "Jeffrey Ciesla"
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, May 04, 2000 1:18 AM
Subject: [asp_databases] Syntax error in UPDATE Statement?
Here is the Update statement. ProjectNotes is the table in the database.
UPDATE ProjectNotes
SET
ProjectNo='::ProjectNo::',
NoteNo='::NoteNo::',
Level='::Level::',
Note='::Note::'
WHERE NoteNo=::NoteNo
All of the fields are there, I just can't figure out why I get the error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
Source: Microsoft OLE DB Provider for ODBC Drivers
Number: -2147217900 (0x80040e14)
Jeffrey P. Ciesla
Information Technology
Oglebay Norton Company
http://www.oglebaynorton.com
|
|
 |