I have a registration form that I'm making and I need to get the count of available spots for each class session. I can't get the array to return something like "0,0,0,0,0,0". Is there a way to do this? There are 6 total classes and they are named 1, 2, 3, 4, 5, and 6.

When you start out, each count will be 0 (meaning no one signed up yet) which makes the openSpots variable equal to 35 (maximum # allowed).
**********************************************************
<%
Set my_rs = Server.CreateObject("ADODB.Recordset")

my_sql = "SELECT COUNT(response) AS classCount, cast(question AS varchar) AS className FROM survey WHERE surveyName='Survey' GROUP BY cast(question as varchar)"

my_rs.open my_sql, my_conn

dim classCountArrayStr, classNameArrayStr
classCountArrayStr = ""
classNameArrayStr = ""

if not(my_rs.bof and my_rs.eof) then
do while not (my_rs.eof)
classCountArrayStr = classCountArrayStr & my_rs.fields("classCount") & ","
classNameArrayStr = classNameArrayStr & my_rs.fields("className") & ","
my_rs.movenext
loop
my_rs.close
end if

if classNameArrayStr = "" then 'first time using this page so no values are set yet
classNameArrayStr = "1,2,3,4,5,6"
end if
%>
...... unrelated code in between

<%
dim classNameArray, classCountArray, openSpots
classNameArray = split(classNameArrayStr,",") 'class values: array(1,2,3,4,5,6)
' classCountArray = split(classCountArrayStr,",")
%>

..... unrelated code in between
<%
if classCountArray(i) < 35 then
openSlots = 35 - classCountArray(i) '35 slots allowed maximum
end if
%>

When I try to use classCountArray(i) I get an error saying "Type mismatch" or "script out of range". The values are first a string and then are converted over to an array. It doesn't find anything for the counts since they are all empty. I'm sure this is something easy, but I've been working on trying to get this to work for like a day now with no luck.

In the SQL statement, the values are being cast into varchars because the database has the fields set up as type memo since it's a re-useable table.