<% set dbEngstrom=Server.CreateObject("ADODB.connection") dbEngstrom.Open Driver={SQL Server Native Client 10.0};Server=Lynx;Database=engstrom;Trusted_Connection=yes; set rs=Server.CreateObject("ADODB.recordset") rs.Open "Select * from Question order by ID", conn for each field in rs.fields response.write(Q.text) response.write(" = ") response.write(Q.text) next rs.Open "Select * from A", conn for each A.ID in rs.fields response.write(A.text) response.write(" = ") response.write(A.text) next num = round(sqrt(A.Max(num))) col = 1 do if Q.text<>OldQ then if col > 1 then do while col <= num write "" col = col + 1 loop end if if col > num write "" write "" & vbCrLf & "" col = num end if if col > num then write "" col = 1 end if if A.text = null write "" col = num else write " " col = col + 1 end if OldQ = Q.text rsQnA.Movenext loop until rsQnA.EOF do while col <= num write " col = col + 1 loop %>
 
" & Q.text & "
"& A.text & "