|
Hi there,
I have a db with tables according to the topics.
I would like to create a form with a drop down where you can select the topic, and acording the topic you select. The filled in fields go to that table...
So the name of the table should be replaced with what is selected in the from (in this case sales_comm)
I have this as code to add to the db:
<% ' Declaring variables Dim titles, sizes, group, sql_insert
' Receiving values from Form sizes = Request.Form("sizes") titles = Request.Form("titles") group = Request.Form("group")
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("Intranet.mdb") sql_insert = "insert into sales_comm (titles, sizes) values ('" & titles & "', '" & sizes & "')" ' Creating Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source con.Execute sql_insert ' Done. Close the connection con.Close Set con = Nothing Response.Write "All records were successfully entered into the database." %>
===================================================
and this as form:
<p> <select size="1" name="group"> <option value="sales_comm">sales comm</option> <option value="corp_comm">corp comm</option> </select> </p> <p>Title<br> <input type="text" size="40" name="titles"> <br> Size<br> <input type="text" size="40" name="sizes"> <br> date<br> <input type="text" size="40" name="date"> <br> download eu<br> <input type="text" size="40" name="download_eu"> <br> download us<br> <input type="text" size="40" name="download_us"> <br> view eu<br> <input type="text" size="40" name="view_eu"> <br> view us<br> <input type="text" size="40" name="view_us"> </p> <p> <input type="Submit" value="Submit" name"Submit"> </font> </p> </form>
Cheerzzz RedRaver
|