Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error Code = 37000 (Syntax error or access violation) Help Me ! 1

Status
Not open for further replies.

jokerparis

Programmer
Jul 7, 2000
15
0
0
FR
i have 2 files :<br><br>the first form.cfm<br><br>&lt;&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;Untitled&lt;/title&gt;&lt;/head&gt;<br>&lt;body&gt;<br> &lt;form action=&quot;nextpage.cfm&quot; method=&quot;POST&quot;&nbsp;&nbsp;name=&quot;formulaire&quot;&gt;<br> Pseudo :<br> &lt;br&gt;&lt;input type=&quot;Text&quot; name=&quot;user&quot; required=&quot;No&quot; size=&quot;10&quot;&gt;&lt;br&gt;<br> Sujet :<br> &lt;br&gt;&lt;input type=&quot;Text&quot; name=&quot;subject&quot; required=&quot;No&quot; size=&quot;80&quot;&gt;&lt;br&gt;<br> Date :<br> &lt;br&gt;&lt;input type=&quot;Text&quot; name=&quot;date&quot; required=&quot;No&quot; size=&quot;10&quot;&gt;&lt;br&gt;<br> Votre Texte :<br> &lt;br&gt;&lt;input type=&quot;Text&quot; name=&quot;body&quot; required=&quot;No&quot; size=&quot;10&quot;&gt;&lt;br&gt;<br> &lt;!--&lt;br&gt;&lt;textarea&nbsp;&nbsp;rows=5 cols=50 name=&quot;body&quot;&gt;Post Goes Here&lt;/textarea&gt;--&gt;<br> &lt;br&gt;&lt;br&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;<br> &lt;/form&gt;<br>&lt;/body&gt;<br><br>&lt;/html&gt;<br><br>and the second :<br><br>&lt;cfquery datasource=&quot;forum&quot;&gt;<br>INSERT INTO&nbsp;&nbsp;question(user_id , subject , body , date)<br>VALUES ( '#user#' , '#subject#' , '#body#' , '#date#' )<br>&lt;/cfquery&gt;<br><br>all my fields in my base are text format and i have a automatic number for the id , when i try to complete the forrm and click submit this message appear :<br><br>Error Diagnostic Information<br>ODBC Error Code = 37000 (Syntax error or access violation)<br><br><br>[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.<br><br><br><br>The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (1:1) to (1:28).<br><br><br>Date/Time: 07/20/00 15:51:05<br>Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)<br>Remote Address: 127.0.0.1<br>HTTP Referer: <A HREF=" TARGET="_new">
 
I don't see the problem right away, but I'm curious about your statement:<br><br>i have a automatic number for the id<br><br>Do you mean that the user_id field is an autonumber field?&nbsp;&nbsp;If so, then you are attempting to store a string into it.&nbsp;&nbsp;I doubt that is the real problem though because you would get a different error (Data Type Mismatch).<br><br>It would be helpful if you could post the definition for the table.
 
Just a thing:<br><br>If the user_Id field is autonumber field you should exclude it from the insert statement<br><br>It would become:<br><br><br>INSERT INTO&nbsp;&nbsp;question(subject , body , date)<br>VALUES ('#subject#' , '#body#' , '#date#' )
 
I thank u for u answer but i have find the matter, it provide from the syntax of ACCESS !!!<br><br>also when u'll see the error 37000 there are many chance that is this.<br><br>in fact i have utilise a fiel named 'date' and for access it's a reserved name, two solutions<br><br>-first the most simple change the field name in your database<br>-second put date in [] as [date]<br><br>Thank u CIAO
 
<br><br>&lt;cfquery datasource=&quot;forum&quot;&gt;<br>INSERT INTO&nbsp;&nbsp;question(user_id , subject , body , date)<br>VALUES ( '#user#' , '#subject#' , '#body#' , '#date#' )<br>&lt;/cfquery&gt;<br><br>You can cgange the user_id <br>values(( '#user_id#')...<br><br>And try it <br>i think it is a problem ..<br>And one more thing Which data base your using if your using <br>sql server back end <br><br>You should must give field names like<br>date_1<br>_date<br><br><br>bye <br>Rathni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top