Hi guys,
This one is driving me nuts. I have two queries. This one works just fine:
<cfquery datasource="#session.dsn#">
INSERT INTO User (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 INTO News (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