date is a reserved word and you should only have '' around text/string data.
if you are trying to put date info in your database you should use 'now()'
as the default data in access and 'getdate()' in mssql7 and not actually
insert the value or the column in your query. go to www.swynk.com and
search for related info on automatic date insertions, there is an alternate
to getdate() in mssql7 that uses a different method of getting the actual
date.
good luck,
alex
-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 09, 2001 12:05 PM
To: CF-Talk
Subject: Syntax error in INSERT INTO statement
Hello,
This gets me all the time. I created a simple survey form; checked and
double-checked all fields and I still get a "Syntax error in INSERT INTO
statement" error. All the fields correspond in the form CF page, and Access
table.
Is there some kind of bug or trick I'm missing here? Any help would be
appreciated.
Robert O.
Web Admin
----------------------------
<CFQUERY name="getsurvey" datasource="survey">
INSERT INTO survey
(Date,info,infosuggestions,bio,quote,quotes,otherquotes,futurepage,onlinecat
alog,catalogfunction,othercatalog,content,contentsuggestions,rate,rateexplan
ation,category,lastcomments,Institution,Name,Title,Email)
VALUES
('#DateFormat(Now())#','#FORM.Info#','#FORM.infosuggestions#','#FORM.Bio#',
'#FORM.Quote#','#FORM.Quotes#','#FORM.Otherquotes#','#FORM.Futurepage#',
'#FORM.Onlinecatalog#','#FORM.Catalogfunction#','#FORM.Othercatalog#',
'#FORM.Content#','#FORM.Contentsuggestions#','#FORM.Rate#','#FORM.Rateexplan
ation#','#FORM.Category#','#FORM.Lastcomments#','#FORM.Institution#','#FORM.
Name#','#FORM.Title#','#FORM.email#')
</cfquery>
-----------------------------
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.
SQL = "INSERT INTO survey
(Date,info,infosuggestions,bio,quote,quotes,otherquotes,futurepage,onlinecat
alog,catalogfunction,othercatalog,content,contentsuggestions,rate,rateexplan
ation,category,lastcomments,Institution,Name,Title,Email) VALUES
('09-Feb-01','','','','','','','','','','','','','','','Select','','vnbvnvbn
b','','','')"
Data Source = "survey"
SQL = "INSERT INTO survey
(Date,info,infosuggestions,bio,quote,quotes,otherquotes,futurepage,onlinecat
alog,catalogfunction,othercatalog,content,contentsuggestions,rate,rateexplan
ation,category,lastcomments,Institution,Name,Title,Email) VALUES
('09-Feb-01','','','','','','','','','','','','','','','Select','','vnbvnvbn
b','','','')"
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (1:1) to (1:46).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists