Syntax Error in Insert into statement asp vb/access

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.  
rhkennerlyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Ryan ChongConnect With a Mentor Commented:
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
 
rhkennerlyAuthor Commented:
Sharp eye, an illegal character.  Thanks!
0
All Courses

From novice to tech pro — start learning today.