I have some code where I am populating a drop down box using dynamic variables. "Selection" could be one of four options, depending on which previous drop down box was selected, and "criteria" is the variable selected from that drop down box. The session variables are populated correctly, but it is retrieving an empty recordset. Am I coding this correctly? Thanks in advance.
criteria=Session("criteria"
selection=Session("selection"
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("scrubbed.mdb"
set conn = server.createobject("adodb.connection"
set rs2= server.createobject("adodb.recordset"
conn.open strconn
strsql="Select nsn from scrubbed_data where '"& selection &"' = '"& criteria &"' order by nsn;"
rs2.open strsql, conn, 2, 2
criteria=Session("criteria"
selection=Session("selection"
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("scrubbed.mdb"
set conn = server.createobject("adodb.connection"
set rs2= server.createobject("adodb.recordset"
conn.open strconn
strsql="Select nsn from scrubbed_data where '"& selection &"' = '"& criteria &"' order by nsn;"
rs2.open strsql, conn, 2, 2