Here's the problem:
On one page I have a form with multiple checkboxes that allows the user to select various different categories to which they want to send their information . For each category, I have a separate table in the database. What I want to do is be able to check to see which checkboxes are checked, and insert the form data into the database to each category (hence each table) that is selected. All the checkboxes have different names (not an array of checkboxes). What I currently have is an if/then statement for each checkbox :
if Request.Form("checkbox_financial"
=true then
sSQL = "insert into FINANCIAL (NAME, SUBJECT, DESCRIPTION) values ('" & nm & "','" & subject & "','" & desc & "');"
oConn.Execute sSQL
end if
if Request.Form("checkbox_manufacturing"
=true then
sSQL = "insert into MANUFACTURING (NAME, SUBJECT, DESCRIPTION) values ('" & nm & "','" & subject & "','" & desc & "');"
oConn.Execute sSQL
end if
set oConn= Nothing
...and various other statements like this for each category
BUT, this isnt working. I dont know where to execute the SQL,or where to end the connection. Also, since all the SQL statements are 'sSQL', would each successive SQL statement overwrite the preceeding one? Any information on this would be greatly appreciated. Thanks in advance.
On one page I have a form with multiple checkboxes that allows the user to select various different categories to which they want to send their information . For each category, I have a separate table in the database. What I want to do is be able to check to see which checkboxes are checked, and insert the form data into the database to each category (hence each table) that is selected. All the checkboxes have different names (not an array of checkboxes). What I currently have is an if/then statement for each checkbox :
if Request.Form("checkbox_financial"
sSQL = "insert into FINANCIAL (NAME, SUBJECT, DESCRIPTION) values ('" & nm & "','" & subject & "','" & desc & "');"
oConn.Execute sSQL
end if
if Request.Form("checkbox_manufacturing"
sSQL = "insert into MANUFACTURING (NAME, SUBJECT, DESCRIPTION) values ('" & nm & "','" & subject & "','" & desc & "');"
oConn.Execute sSQL
end if
set oConn= Nothing
...and various other statements like this for each category
BUT, this isnt working. I dont know where to execute the SQL,or where to end the connection. Also, since all the SQL statements are 'sSQL', would each successive SQL statement overwrite the preceeding one? Any information on this would be greatly appreciated. Thanks in advance.