HighDots Forums  

INSERT INTO syntax error (damn!)

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss INSERT INTO syntax error (damn!) in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gbalaguer webforumsuser@macromedia.com
 
Posts: n/a

Default INSERT INTO syntax error (damn!) - 12-04-2003 , 03:26 PM






Please, please, please help me with this...

I have a form already working in a IIS and inserting rows in a MS-Acces database. The page was made with Dreamweaver and uses ASP for the form. Everything was working fine, I tested it many times and the records were inserted without problems... today a made some modifications to the form and arrrghh!!! it's not working anymore. I opened older versions (backups) of the form and they all show the same error: when pressing the button for submit, it shows the next message in the Internet Explorer (without inserting anything). It's very strange because all the old versions worked fine during the tests.

========================================
Tipo de error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis en la instrucción INSERT INTO.
/encuesta.asp, línea 78


Tipo de explorador:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Página:
POST 350 bytes to /encuesta.asp

Datos de POST:
edad=&sexo=0&ditrito_vive=0&lugar_almuerzo=0&gasta _almuerzo=0&razon_satisfaccion=&dejodieta=&dejoser vdieta=&evalua_idea=0&programa_adicional=&DAC_moti vo=&eval_lonchera=0&motivo_lonchera=&temperatura=0 . . .

=======================================

This is the line 78 that seems to be the problem

71 MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ") values (" + MM_dbValues + ")";
72
73 if (!MM_abortEdit) {
74 // execute the insert
75 var MM_editCmd = Server.CreateObject('ADODB.Command');
76 MM_editCmd.ActiveConnection = MM_editConnection;
77 MM_editCmd.CommandText = MM_editQuery;
78 MM_editCmd.Execute();
79 MM_editCmd.ActiveConnection.Close();

if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);


Does anyone have any idea? I'm in really trouble... needed to put this form on-line today!

Thanks a lot...

Giancarlo

PS: could it be something with the java version?




Reply With Quote
  #2  
Old   
Nancy Gill
 
Posts: n/a

Default Re: INSERT INTO syntax error (damn!) - 12-04-2003 , 03:27 PM






It's referencing Line 78 cause that is the line that executes the command ..
not necessarily the problem. INSERT INTO problems usually mean you have a
reserved word as a field name .. which in Spanish, I'm not sure what they
would be. In English, things like "name" or "date" or characters like a -
in "e-mail" are all reserved and will throw this error.


--
Nancy Gill
Team Macromedia Volunteer for Dreamweaver MX/UltraDev
http://www.macromedia.com/go/team/
BLOG: http://www.dmxwishes.com/blog.html
Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
Technical Editor: Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web Development

"gbalaguer" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Please, please, please help me with this...

I have a form already working in a IIS and inserting rows in a MS-Acces
database. The page was made with Dreamweaver and uses ASP for the form.
Everything was working fine, I tested it many times and the records were
inserted without problems... today a made some modifications to the form and
arrrghh!!! it's not working anymore. I opened older versions (backups) of
the form and they all show the same error: when pressing the button for
submit, it shows the next message in the Internet Explorer (without
inserting anything). It's very strange because all the old versions worked
fine during the tests.
Quote:
========================================
Tipo de error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis en la
instrucción INSERT INTO.
/encuesta.asp, línea 78


Tipo de explorador:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Página:
POST 350 bytes to /encuesta.asp

Datos de POST:

edad=&sexo=0&ditrito_vive=0&lugar_almuerzo=0&gasta _almuerzo=0&razon_satisfac
cion=&dejodieta=&dejoservdieta=&evalua_idea=0&prog rama_adicional=&DAC_motivo
=&eval_lonchera=0&motivo_lonchera=&temperatura=0 . . .
Quote:
=======================================

This is the line 78 that seems to be the problem

71 MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues +
") values (" + MM_dbValues + ")";
72
73 if (!MM_abortEdit) {
74 // execute the insert
75 var MM_editCmd = Server.CreateObject('ADODB.Command');
76 MM_editCmd.ActiveConnection = MM_editConnection;
77 MM_editCmd.CommandText = MM_editQuery;
78 MM_editCmd.Execute();
79 MM_editCmd.ActiveConnection.Close();

if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);


Does anyone have any idea? I'm in really trouble... needed to put this
form on-line today!

Thanks a lot...

Giancarlo

PS: could it be something with the java version?





Reply With Quote
  #3  
Old   
gbalaguer webforumsuser@macromedia.com
 
Posts: n/a

Default Re: INSERT INTO syntax error (damn!) - 12-04-2003 , 06:13 PM



This was the problem. You were right about the reserved words... I had a fiel named "set" and a column of the database with the same name... renaming it made the page work.

I still don't know why the older versions didn't work, but doesn't have time to find out...

Thanks a lot...

Giancarlo



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.