<html>
<title>Test</title>
<body bgcolor="FFFFFF">
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=SQLOLEDB.1;Password=123;Persist Security Info=True;User ID=sa;Initial Catalog=123;Data Source=1234"
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from 1234"
rs.open SQL, conn
response.write("<table border='1'>")
While Not rs.EOF
response.write("<tr><td>" & rs("Name") & "</td><td>" & rs("PID") & "</td><td>" & rs("Coords") & "</td><td>" & rs("Items") & "<select size='3' name='itemlist'>Array through option tags here????</select></td></tr>")
rs.MoveNext
Wend
response.write("</table>")
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
%>
</body>
</html>
My rs(“Items”) contains many comma delimited values, I’d like to add each item to the listbox. Can someone point me in the right direction? thanks!
You can change your response.write line in the while/wend loop to this, which will create a select box with the comma separated values from rs(“Items”):
If you need to do anything more complex like have separate select option values/text, or need to pre-select an option, then you will need to expand upon this.