l've created an Access db with these fields (Title, Body and Section) Section field is Lookup column (About Me, Contact and Links). Also I created a form on add_data.asp to add data from it. On the form there's a Drop Down Menu. The peoblem is how to add from the drop down menu to the database. Here's my code:
Note that I have no problem to add data to my db eccept with this drop down menu!
<%@language=VBScript>
<html>
<BOD>
<!--#include file="connection.txt"-->
<%
section=request.form("section")
title = request.form ("title")
body = request.form ("body")
If title="" or body="" then
response.write "<center>" & "Please re-enter your data again !"
Else
addSQL= " insert into project (section,title,body) values ('"§ion&"','"&title&"','"&body&"') "
ADO.execute(addSQL)
response.redirect "add_data.asp"
End if
%>
<form method="POST" action="add_data.asp">
<p>Section:
<select size="1" name="section">
<option value="About Me">About Me</option>
<option value="Links">Links</option>
<option value="Contact">Contact</option>
</select></p>
<p>Title: <input type="text" name="title" size="20"></p>
<p>Body: <input type="text" name="body" size="20"></p>
<p><input type="submit" value="ADD" name="add"></p>
</form>
<%
ADO.close
Set ADO=Nothing
%>
</body>
</html>
Thanks in advance !
Note that I have no problem to add data to my db eccept with this drop down menu!
<%@language=VBScript>
<html>
<BOD>
<!--#include file="connection.txt"-->
<%
section=request.form("section")
title = request.form ("title")
body = request.form ("body")
If title="" or body="" then
response.write "<center>" & "Please re-enter your data again !"
Else
addSQL= " insert into project (section,title,body) values ('"§ion&"','"&title&"','"&body&"') "
ADO.execute(addSQL)
response.redirect "add_data.asp"
End if
%>
<form method="POST" action="add_data.asp">
<p>Section:
<select size="1" name="section">
<option value="About Me">About Me</option>
<option value="Links">Links</option>
<option value="Contact">Contact</option>
</select></p>
<p>Title: <input type="text" name="title" size="20"></p>
<p>Body: <input type="text" name="body" size="20"></p>
<p><input type="submit" value="ADD" name="add"></p>
</form>
<%
ADO.close
Set ADO=Nothing
%>
</body>
</html>
Thanks in advance !