While Not objRS1.EOF
Response.Write ("<option")
If (objRS1(0) = strTemp1) Then
Response.Write (" selected")
End If
Response.Write (" value=" & objRS1(0) & ">" & objRS1(1) & "</option>")
objRS1.MoveNext
Wend
Try it like this
While Not objRS1.EOF
Response.Write ("<option")
If objRS1(0) = strTemp1 Then
Response.Write (" selected")
End If
Response.Write (" value=" & objRS1(0) & ">" & objRS1(1) & "</option>")
objRS1.MoveNext
Wend
Do you have a link I can take a look at?
Set objRS1 = Server.CreateObject("ADODB.Recordset")
Set objRS1.ActiveConnection = objConn
strQ = "SELECT Plants.ID, Plants.Description FROM Plants;"
objRS1.Open strQ
While Not objRS1.EOF
Response.Write ("<option")
If (objRS1(0) = strTemp1) Then
Response.Write (" selected")
End If
Response.Write (" value=" & objRS1(0) & ">" & objRS1(1) & "</option>")
objRS1.MoveNext
Wend
objRS1.Close
Set objRS1 = Nothing
%>
</select><br>
<%
'Response.Write("<option value=all>All Plants</option>")
Set objRS1 = Server.CreateObject("ADODB.Recordset")
Set objRS1.ActiveConnection = objConn
' Here you give the SQL command
strQ = "SELECT * FROM users;"
objRS1.Open strQ
' Here you execute the SQL command
Set rs = con.Execute (strQ)
' Here is your WHILE Loop
While Not objRS1.EOF
Response.Write ("<option")
' Here we have your IF statement
If (objRS1(0) = strTemp1) Then
Response.Write (" selected")
End If
Response.Write (" value=" & objRS1(0) & ">" & objRS1(1) & "</option>")
objRS1.MoveNext
Wend
objRS1.Close
Set objRS1 = Nothing
%>
I think what it is, is that you did not execute the SQL command. Also, are you doing an array variable with objRS1(0)?