I've run into this sort of thing a few times.  9 times out of 10 it is
because of the database not your insert statement.  Make sure you have all
the field types in the database correctly (IE a string vs an integer), and
that you are sending to the database as such.

What I generally end up doing is switching all the fields to text, and then
one by one switching them to what they should be until I find the one that's
giving me the error.

Hope that helps.
James


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFB542.15933410
Content-Type: text/plain;
        charset="iso-8859-1"

I have checked and checked this but I cannot see anything wrong with this
code:

<cfquery name="adduser" datasource="#DSN#">
insert into users
(user_id,Group,firstname,lastname,Title,email,Password,UserID,ClientID)
values
(#max_ID#,'#trim(attributes.Group)#','#trim(attributes.firstname)#','#trim(a
ttributes.lastname)#','#trim(attributes.Title)#','#trim(attributes.email)#',
'#trim(attributes.Password)#','#trim(attributes.userid)#',#trim(attributes.C
lientID)#)
</cfquery>

But I keep getting this error:

ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.


SQL = "insert into users
(user_id,Group,firstname,lastname,Title,email,Password,UserID,ClientID)
values
(2,'External','Shawn','Regan','Webmaster','[EMAIL PROTECTED]','kick','597',2)"

Anyone see what I am missing?

Shawn Regan

------_=_NextPart_001_01BFB542.15933410
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>OT: SQL! i'm losing it</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>I have checked and checked this but I cannot see =
anything wrong with this code:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;cfquery name=3D&quot;adduser&quot; =
datasource=3D&quot;#DSN#&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>insert into users =
(user_id,Group,firstname,lastname,Title,email,Password,UserID,ClientID) =
values =
(#max_ID#,'#trim(attributes.Group)#','#trim(attributes.firstname)#','#tr=
im(attributes.lastname)#','#trim(attributes.Title)#','#trim(attributes.e=
mail)#','#trim(attributes.Password)#','#trim(attributes.userid)#',#trim(=
attributes.ClientID)#)</FONT></P>

<P><FONT SIZE=3D2>&lt;/cfquery&gt;</FONT>
</P>

<P><FONT SIZE=3D2>But I keep getting this error:</FONT>
</P>

<P><FONT SIZE=3D2>ODBC Error Code =3D 37000 (Syntax error or access =
violation)</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>[Microsoft][ODBC Microsoft Access Driver] Syntax =
error in INSERT INTO statement.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>SQL =3D &quot;insert into users =
(user_id,Group,firstname,lastname,Title,email,Password,UserID,ClientID) =
values =
(2,'External','Shawn','Regan','Webmaster','[EMAIL PROTECTED]','kick','597'=
,2)&quot;</FONT></P>

<P><FONT SIZE=3D2>Anyone see what I am missing?</FONT>
</P>

<P><FONT SIZE=3D2>Shawn Regan</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BFB542.15933410--
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to