With the following code I get an HTTP 500 error. What am I missing, please? I have the connection and it test o.k. with a simple Select * query. I am trying to populate a dropdown box from an Access table.
Also, I would like to purchase an ASP 'toolkit' with fiffernet ASP form components. Any suggestions on a good source will be appreciated. Thanks for any help.

<%@ Language=VBScript %>
<%Option explicit
Dim oRs, conn, connect, strSQL
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("courses.mdb") & ";Persist Security Info=False"
conn.Open connect
<title>Example combo box</title>
<script language="javascript">
function dept_onchange(frmSelect) {
The following was selected : <%=Request.Form ("courses")%>
<form name="frmSelect" method="Post" action="select.asp">
<SELECT name=courses LANGUAGE=javascript onchange="return dept_onchange(frmSelect)">
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT CourseName FROM tblCourses ORDER BY CourseName"
oRs.Open strSQL, conn

Do while not oRs.EOF
if Request.Form("courses") = oRs("CourseName") then 'if this is the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRS ("CourseName") & "' SELECTED>"
Response.Write oRs("CourseName") & "</Option>"
Response.Write "<OPTION VALUE = '" & oRs ("CourseName") & "'>"
Response.Write oRs("CourseName") & "</Option>"
end if

what i see right now is

Security Info=False"

correct it to "False"
i'll check the whole code sometime later and sooner

This article has been dead for over six months. Start a new discussion instead.