|
See Highlight below in red - Where you see 'AME' - I need to put the variable from the drop down. Can I do this on the same page or do I need to have the dropdown and then load this page?
<% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsevent 'Holds the recordset for the records in the database Dim strSQL 'Holds the SQL query for the database
'Create an ADO connection odject Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("midga.mdb")
'Set an active connection to the Connection object using DSN connection 'adoCon.Open "DSN=midga"
'Create an ADO recordset object Set rsevent = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT church.* FROM church order by city, Denomination, church;"
'Open the recordset with the SQL query rsevent.Open strSQL, adoCon
'Loop through the recordset Do While not rsevent.EOF If (rsevent("Denomination"))= "AME" then 'Write the HTML to display the current record in the recordset Response.Write ("<br>") Response.Write ("<a href=""display_form.asp?ID=" & rsevent("ID") & """>") Response.Write (rsevent("Church")) Response.Write ("</a>") ' Response.Write (" ") ' Response.Write (rsevent("Denomination")) Response.Write (" ") Response.Write (rsevent("city")) end if 'Move to the next record in the recordset rsevent.MoveNext
Loop
'Reset server objects rsevent.Close Set rsevent = Nothing Set adoCon = Nothing %>
|