Empty Recordset problems

Results 1 to 2 of 2

Thread: Empty Recordset problems

  1. #1
    Join Date
    Dec 1969

    Default Empty Recordset problems

    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.<BR><BR>criteria=Session("criteria")<BR>se lection=Session("selection")<BR>strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("scrubbed.mdb")<BR>set conn = server.createobject("adodb.connection") <BR>set rs2= server.createobject("adodb.recordset") <BR>conn.open strconn<BR>strsql="Select nsn from scrubbed_data where &#039;"& selection &"&#039; = &#039;"& criteria &"&#039; order by nsn;" <BR>rs2.open strsql, conn, 2, 2 <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Empty Recordset problems

    Dont put &#039; around [selection]. In this case [selection] is an columnname so you shouldn&#039;t put &#039; around it. Just use this:<BR><BR>="Select nsn from scrubbed_data where "& selection &" = &#039;"& criteria &"&#039; order by nsn;" <BR><BR>Peter<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts