?
Solved

Syntax Error in Insert into statement asp vb/access

Posted on 2005-03-07
2
Medium Priority
?
400 Views
Last Modified: 2010-04-25
win_xp, iis 5.0, asp VB_script, dw mx 2004, access db.

Here's one that is driving me crazy:

Transaction failed!
Your SQL:
INSERT INTO cto_survey (n01_a,n01_b,n01_c,n02_a,n02_b,n03,n04_a,n04_b,n05_a,n05_b,n06_a,n06_b,n07,n08_a,n08_b,n09_a,n09-b,n10,n11_a,n11_b,n12_a,n12_b,n13,n14_a,n14-b,n15_a,n16,n17_a,n17_b,n18,n19,n20) VALUES (1,1,1,1,1,1,1,1,1,1,1,'test',1,1,'test',1,'test',1,1,'test',1,'test','test',1,'test',1,1,1,1,'test','test','test')
Error Msg:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

Another table in the same db allows inserts, so I assume I've got permissions worked out (although this is my first project on a totally new install on a new machine, so anything is possible.)

I've tried this by both creating an insert from scratch as well as by using the Application > insert record wizard.  I've carefully reviewed and cross matched the columns and submit as in the asp with the info in the table in the db.  

I've been careful not to include the auto increment primary key in the db in the insert statement.  

Any ideas would be greatly appreciated.  
0
Comment
Question by:rhkennerly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 2000 total points
ID: 13478333
INSERT INTO cto_survey (
n01_a,n01_b,n01_c,n02_a,
n02_b,n03,n04_a,n04_b,
n05_a,n05_b,n06_a,n06_b,
n07,n08_a,n08_b,n09_a,
n09-b,n10,n11_a,n11_b,
n12_a,n12_b,n13,n14_a,
n14-b,n15_a,n16,n17_a,
n17_b,n18,n19,n20
) VALUES (
1,1,1,1,
1,1,1,1,
1,1,1,'test',
1,1,'test',1,
'test',1,1,'test',
1,'test','test',1,
'test',1,1,1,
1,'test','test','test'
)

Seems like the fields and values are equivalent, yet i found you got a field called as "n09-b".

Is this a typo? is "n09-b" should be as "n09_b" ? or if it's the exact field name, then you may need to branket that field, to become as:

[n09-b]

Will this work now?

regards
0
 

Author Comment

by:rhkennerly
ID: 13479879
Sharp eye, an illegal character.  Thanks!
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question