|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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
Thanks in advance..really appreciate the advice on this one. |
|
|||
|
Try to do a loop and for each cycle do a insert in database
Code:
For(i=0;i<40;i++)
{
SQL = "insert into survey_answers (name, answer_num, answer_a, answer_b)"
SQL = SQL & "values ('" & Name & "', 'i', '" & A_iA & "', '" & A_iB & "')"
rs.Open sql, cn
}
Regards Adrian http://www.mydomaintracker.net |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |