Forums

ASP

This topic is locked

Syntax error in INSERT INTO statement.

Posted 06 Oct 2005 12:34:40
1
has voted
06 Oct 2005 12:34:40 Duane Allam posted:
I'm building a database (access 2000/jet4.0) driven site in ASP using dreamweaverMX and in the "add product" page i've written, i get the following error:

Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/bowling/admin/addBall.asp, line 116

the sql statement in question:

<pre id=code><font face=courier size=2 id=code>insert into ballTable (image,manufacturer,description,colour,coverStock,RRP,WHS,weights) values ('','Columbia 300','White Dot','','Reactive',185.19,130.19,'6;8;9;10;11;12;13;14;15;16') </font id=code></pre id=code>

As far as i can tell, there aren't any syntax errors (although i'll admit i am an sql n00b <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> i did have reserved keywords in there before)

The code that constructs the sql statement is the code generated by dreamwaver MX in Application-&gt;Server Behaviours-&gt;Insert record. I havent touched it, only put in on error resume next to obtain the sql string. I'm sure most of you have seen this block of code a thousand times already, so dont think i need to re-post it.

Does anyone out there have any idea what might be going on?

And seeing as this is my first post here, Hi, look forward to lurking around here more often <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Replies

Replied 06 Oct 2005 22:32:57
06 Oct 2005 22:32:57 Simon Martin replied:
Welcome to the Zones Duane,

1st thing I'd do when getting an error like that would be to trim back the statement so to just a single value. Then add each item in and test it until you find the cause of your troubles.
You might find the semi colon ';' is causing odd things to happen in your SQL as Access uses it to indicate the end of a statement.



Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 07 Oct 2005 07:40:18
07 Oct 2005 07:40:18 Duane Allam replied:
I took the value-by-value approach as you sugested simon, and it appears that "image" as a field name was causing the problem. -thanks for the advice

changed "image" to "imageURL" and it works!

What really grinds my gears is that "image" is not included in Micro$oft's reserved words list:,
from support.microsoft.com/kb/q209187/
-H
HAVING
-I
Idle
IEEEDOUBLE, IEEESINGLE
If
IGNORE
Imp
IN
INDEX
Index, Indexes
INNER
INSERT
InsertText
INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
INTO
IS
-J
JOIN


live & learn i guess

Reply to this topic