SQL microsoft access syntax error

Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/class/ObjectSQL.inc, line 52

i get this error using the code snippet attached, i must be missing the error in the query...

any help to find it will be much appreciated!
thanks

INSERT INTO FREEPRODUCT
(FREEPRODUCT_ID, AREA_ID, FREEPRODUCT_Title, FREEPRODUCT_Description
, FREEPRODUCT_Sources, FREEPRODUCT_LastUpdated, FREEPRODUCT_GLIDE
, FREEPRODUCT_Folder, FREEPRODUCT_MinX, FREEPRODUCT_MaxY, FREEPRODUCT_MaxX
, FREEPRODUCT_MinY, FREEPRODUCT_Img, CoverImage, Image, FREEPRODUCT_URL1
, mapLink, FREEPRODUCT_Size1, FREEPRODUCT_URL2, mapLink2, FREEPRODUCT_Size2
, SHP_Link, GDB_Link, KML_Link, WMS_Link, PTypeStat, SC_Data, NV_Data, GP_Data
) VALUES(1660, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)

Open in new window

LVL 1
weaverkAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
for one, check this field "FREEPRODUCT_LastUpdated", if this a date/time field, it needs a date value like
#1/1/2011# that must be enclosed in "#"

INSERT INTO FREEPRODUCT(FREEPRODUCT_ID, AREA_ID, FREEPRODUCT_Title, FREEPRODUCT_Description, FREEPRODUCT_Sources, FREEPRODUCT_LastUpdated, FREEPRODUCT_GLIDE, FREEPRODUCT_Folder, FREEPRODUCT_MinX, FREEPRODUCT_MaxY, FREEPRODUCT_MaxX, FREEPRODUCT_MinY, FREEPRODUCT_Img, CoverImage, Image, FREEPRODUCT_URL1, mapLink, FREEPRODUCT_Size1, FREEPRODUCT_URL2, mapLink2, FREEPRODUCT_Size2, SHP_Link, GDB_Link, KML_Link, WMS_Link, PTypeStat, SC_Data, NV_Data, GP_Data) VALUES(1660, 1, 1, 1, 1, #1/1/2011#, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)


and for all Text data types fields, the values must be enclosed in single quotes( '1' )
0
 
Dale FyeCommented:
Well, that isn't really a code segment, it is a SQL statement.

My guess is that some of the fields you are attempting to write to are text fields, and all of the values you are attempting to insert are numeric.

What is the actual code that is responsible for calling this SQL insert statement?
0
 
mbizupCommented:
Assuming that all of the data is okay fro the field types, try this variation (and try it directly in the query builder before putting it into VBA code):

INSERT INTO FREEPRODUCT(FREEPRODUCT_ID, AREA_ID, FREEPRODUCT_Title, FREEPRODUCT_Description, FREEPRODUCT_Sources, FREEPRODUCT_LastUpdated, FREEPRODUCT_GLIDE, FREEPRODUCT_Folder, FREEPRODUCT_MinX, FREEPRODUCT_MaxY, FREEPRODUCT_MaxX, FREEPRODUCT_MinY, FREEPRODUCT_Img, CoverImage, [Image], FREEPRODUCT_URL1, mapLink, FREEPRODUCT_Size1, FREEPRODUCT_URL2, mapLink2, FREEPRODUCT_Size2, SHP_Link, GDB_Link, KML_Link, WMS_Link, PTypeStat, SC_Data, NV_Data, GP_Data) VALUES(1660, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) 

Open in new window

0
 
weaverkAuthor Commented:
amazing advice, straight to the problem... it was a date time field, once i gave it the correct input and added the # # as you mentioned, it worked perfectly!
many thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.