View Single Post
  #1 (permalink)  
Old 02-15-2006, 05:22 PM
jpdeveloper jpdeveloper is offline
WebProWorld New Member
 
Join Date: Feb 2006
Posts: 12
jpdeveloper RepRank 0
Default Error inserting 40 rows into access database table at once?

I am continually getting the error:
[Microsoft][ODBC Microsoft Access Driver] Missing semicolon (;) at end of SQL statement.

I have a web based ASP web form which the user will enter a name and answer 40 questions then have those answers insert into an access database. I have my answer table setup as field names:
Name
answer_num
answer_a
answer_b
since there is two answer for each question.
I know how to insert into the table all as one row but I was getting errors when trying to pass a total of 40 rows at one time. I hard coded the answer number but wanted to grab the name entered and the two answer (A_1A-first answer for question1)&(A_1B-second answer for question1) that the user selected from the form.
This is a part of the insert that I have:

Code:
SQL = "insert into survey_answers (name, answer_num, answer_a, answer_b)"

SQL = SQL & "values ('" & Name & "', '1', '" & A_1A & "', '" & A_1B & "')"

SQL = SQL & "values ('" & Name & "', '2', '" & A_2A & "', '" & A_2B & "')"

 rs.Open sql, cn
Basically am I going about this all wrong, do I need to set up my table differently? Or is this even possible to do? Any input in this one?
Thanks in advance..really appreciate the advice on this one.
Reply With Quote