<%
'Open the database connection
cst = "Driver={Microsoft Access Driver (*.mdb)};DBQ="
cst = cst & server.mappath("dilemma.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.Open cst
'Ask the question, in this case we fetch all the dilemmas in the DB.
sSQL = "SELECT * FROM dil_question"
'execute the question and get the recordset
Set Rs = Conn.Execute(sSQL)
'output all the rows in the recordset.
Do While NOT Rs.EOF
Response.Write("" + Rs.Fields("dil_header") + "
") Response.Write(Rs.Fields("dil_question1") + " ") Response.Write(Rs.Fields("dil_question2") + " ") Response.Write(" ") Response.Write(" ") if not Rs.Fields("dil_choice3") = "" then Response.Write(" ") end if Response.Write("Ägare: " + Rs.Fields("dil_owner") + " ") Response.Write(" ") Rs.MoveNext Loop ' Close the Recordset object and destroy it Rs.Close set Rs = Nothing ' Close the connection and destroy it Conn.Close set Conn = Nothing set sSQL = Nothing %> |
||