Hi
 
Try putting single quotes around the 'Date' field name in the insert statement - Access can be a bit picky about reserved names:
<cfquery datasource="#session.dsn#">
INSERT INTONews (Headline, Body, 'Date', PostedBy)
VALUES
('#FORM.Headline#','#FORM.NewsBody#','#FORM.Date#','#session.CharName#')
</cfquery>
 
hth
 
Antony

>>> [EMAIL PROTECTED] 16/12/2003 9:08:33 am >>>
Hi guys,

This one is driving me nuts. I have two queries. This one works just fine:

<cfquery datasource="#session.dsn#">
INSERT INTOUser (CharacterName, RealName, Password, Status)
VALUES
('#FORM.CharacterName#','#FORM.RealName#','#password#','#FORM.Status#')
</cfquery>


This one, on the other hand, doesn't:

<cfquery datasource="#session.dsn#">
INSERT INTONews (Headline, Body, Date, PostedBy)
VALUES
('#FORM.Headline#','#FORM.NewsBody#','#FORM.Date#','#session.CharName#')
</cfquery>


This is the error I get when I try to run the first one:

Error Occurred While Processing Request
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 News (Headline, Body, Date, PostedBy) VALUES
('Test','test test','12/16/2003','Webmistress')"

Data Source = "FBGALAN"

The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (2:2) to (2:37).

The error occurred while processing an element with a general identifier of
(CFRETHROW), occupying document position (246:11) to (246:21).

Date/Time: 12/16/03 09:07:38
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Remote Address: 192.168.0.2
Query String: fuseaction=GM.SaveNews



I've checked that the fieldnames are spelled right (as is the table name). I
have even changed the date field to just "text" rather than "date/time" on
the basis that it might have been the date formatting that was messing
things up, but it still won't work. :(

Can someone please help me figure out what's going wrong?

Cheers,

Seona.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 9/12/2003


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
----------------------------------------------------------------------
Maddocks
Melbourne - Tel: (61 3) 9288 0555 Fax: (61 3) 9288 0666
Sydney - Tel: (61 2) 8223 4100 Fax: (61 2) 9221 0872
Web: http://www.maddocks.com.au
----------------------------------------------------------------------
The information in this electronic mail is privileged
and confidential, intended only for use of the individual
or entity named. If you are not the intended recipient,
any dissemination, copying or use of the information is
strictly prohibited. If you have received this transmission
in error please delete it immediately from your system
and inform us by email on [EMAIL PROTECTED]
----------------------------------------------------------------------
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to