|
BeTheBall -> RE: Results grouped and in row (3/4/2007 10:42:20)
|
I would recommend an array via GetRows and I would use faux rows on the second row of data. The heading row would not be difficult, but the project name and score being on separate rows is problematic due to the way html tables are built. You would be asking the code to build one column of one row followed by a column of the next row and then going back to the first row to insert the next column and so on. Quite a challenge in my opinion. However, you could use two divs inside each column to make the project and score appear to be in different rows. This code is not tested, however, give it a try. You will need to add your own styling to the table and the divs. <%
Dim conntemp, myDSN, myRS, mySQL, arrRecord
Set conntemp=Server.CreateObject("ADODB.Connection")
myDSN ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../../fpdb/grade.mdb")
conntemp.open myDSN
mySQL = "SELECT project, nameInput, total FROM filesquery order by nameInput Asc,order0 asc"
Set myRS = Server.CreateObject("ADODB.Recordset")
myRS.Open mySQL, conntemp, 0, 1
arrRecords=myRS.GetRows
myRS.Close
Set myRS = nothing
conntemp.Close
Set conntemp = nothing
%>
<html>
<head>
<style type="text/css">
table{border-collapse:collapse;}
th {border:1px solid #000000;padding:5px}
div{border:1px solid #000000;padding:5px}
</style>
</head>
<body>
<table>
<%
Header = ""
for i = 0 to Ubound(arrRecords,2)
If Header <> arrRecords(0,i) Then
Header=arrRecords(0,i)
Response.write("<tr><td>" & Header & "</td></tr><tr><td><div>" & arrRecords(1,i) & "</div><div>" & arrRecords(2,i) &"</div></td>")
Else
Response.write("<td><div>" & arrRecords(1,i) &"</div><div>"& arrRecords(2,i) & "</div></td>")
End If
Next
%>
</tr>
</table>
</body>
</html>
|
|
|
|