Thanks for the faq. It doesnt seem to be running the asp code on the page
that was posted.
Here is the code that I want to run again after I return from the server.
set cn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
set pmrs = Server.CreateObject("ADODB.Recordset")
dim strSQL
cn.Open "Provider=SQLOLEDB;Data Source=Regulus;Initial Catalog=" & ldb &
";User ID=" & luser & ";Password=" & lpwd
' string looks like 1:1:smith, john:01:13
lclass = request.form("selectclass")
strlen = len(lclass)
dim classarray(10)
cnt = 0
colonpos = instr(lclass,":")
tmpstr = lclass
lschoolkey = Left(tmpstr,colonpos - 1)
classarray(0) = lschoolkey
i=1
if session("spschooltype") <> "S" then
'elementary schools have a division
params = 4
else
params = 3
end if
while i < params
tmpstr = mid(tmpstr,colonpos + 1, strlen)
colonpos = instr(tmpstr,":")
classarray(i)= left(tmpstr,colonpos - 1)
i = i + 1
wend
'get the last element into the array
if params = 3 then
tmpstr = mid(tmpstr,colonpos+1, strlen)
classarray(params) = left(tmpstr,instr(tmpstr,":")-1)
else
classarray(params) = right(tmpstr,2)
end if
strSQL = " select b.school_key, b.Teacher, b.Grade, b.Division, " & _
" c.Student_key, c.Student_ID, c.Student_Name,
d.Performance_Measure_key, d.Score, e.performance_measure, b.class_key " & _
" from dbo.Class b, dbo.Student c, dbo.Score d, performance_measure e "
& _
" where d.class_key = b.class_key " & _
" and c.student_key = d.student_key " & _
" and d.performance_measure_key = e.performance_measure_key and
d.performance_measure_key = " & left(request.form("selectmeasure"),
instr(request.form("selectmeasure"),":")-1) & " " & _
" and b.school_key = " & classarray(0) & " and b.class_key = " &
classarray(1) & " " & _
" and b.Teacher = '" & classarray(2) & "' and b.grade = '" &
classarray(3) & "' "
response.write "sql string first=" & strsql <=============THIS IS BLANK ON
THE SCREEN========
if params = 4 then
strSQL = strSQL & " and b.division='" & classarray(4) & "' " & " order by
b.teacher, b.grade, b.division, c.student_name "
else
strSQL = strSQL & " order by b.teacher, b.grade, c.student_name "
end if
' response.write "sql string second=" & strsql
rs.open strsql, cn , 1, 1
if err.number <> 0 then <===============THEN IT GIVES ME AN ERROR HERE
BECAUSE THE STRSQL IS BLANK>
thanks again for you help, Peter,
Will