I am trying display information from two related tables out of a database. After creating an inner join query, I use the following to display the information
MyArray = rsmastdetail.GetRows()
Const Mydegree = 19
dim vartemp
vartemp = 0
Response.Write("<p>")
For x = 0 To Ubound(MyArray,2)
If (vartemp <> MyArray(0,x)) then
vartemp = MyArray(0,x)
Response.Write("Id: " & MyArray(0,x) _
& "<br>Institution: " & MyArray(1,x) _
& "<br>Department 1: " & MyArray(2,x) _
& "<br>Department 2: " & MyArray(3,x)& "<br>Degree: " & MyArray(Mydegree, x))
Else
Response.Write(MyArray(Mydegree, x) & "<br>")
End If
Response.Write("</p><hr>")
Next
The problem is that many of the Institutions offer more than one degree. The "degrees" are not displayed continuously as it loops once and displays the degree once. Only if it goes into the else statement will the other degrees be displayed this caused to display a new paragraph. I have tried all I can think of but not found a solution on how to loop through the degrees to display them continously.
Here is an example on how they show up:
Id: 766
Institution: Oxnard College
Department 1:
Department 2:
Degree: AS in Addictive Disorders Studies
------------------------------------------------------------
Addictive Disorders Studies Certificate
------------------------------------------------------------
Addictive Disorders Studies in the Criminal Justice System Certificate
Thank you for any help and tips
MM
MyArray = rsmastdetail.GetRows()
Const Mydegree = 19
dim vartemp
vartemp = 0
Response.Write("<p>")
For x = 0 To Ubound(MyArray,2)
If (vartemp <> MyArray(0,x)) then
vartemp = MyArray(0,x)
Response.Write("Id: " & MyArray(0,x) _
& "<br>Institution: " & MyArray(1,x) _
& "<br>Department 1: " & MyArray(2,x) _
& "<br>Department 2: " & MyArray(3,x)& "<br>Degree: " & MyArray(Mydegree, x))
Else
Response.Write(MyArray(Mydegree, x) & "<br>")
End If
Response.Write("</p><hr>")
Next
The problem is that many of the Institutions offer more than one degree. The "degrees" are not displayed continuously as it loops once and displays the degree once. Only if it goes into the else statement will the other degrees be displayed this caused to display a new paragraph. I have tried all I can think of but not found a solution on how to loop through the degrees to display them continously.
Here is an example on how they show up:
Id: 766
Institution: Oxnard College
Department 1:
Department 2:
Degree: AS in Addictive Disorders Studies
------------------------------------------------------------
Addictive Disorders Studies Certificate
------------------------------------------------------------
Addictive Disorders Studies in the Criminal Justice System Certificate
Thank you for any help and tips
MM