Her er løsningen:
<%@ LANGUAGE="VBSCRIPT" %>
<% '
http://www.eksperten.dk/spm.asp?id=19600 ' %>
<% Set DataAccess = Server.CreateObject("ADODB.Connection") %>
<% DataAccess.Open Session("Database.Global") %>
<% Set MatrixData = DataAccess.Execute("Select* FROM Farver ORDER BY Farve, Size ASC;") %>
<TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="*" HEIGHT="*" HSPACE="0" VSPACE="0">
<TR><TD>Farve</TD><TD>6</TD><TD>8</TD><TD>10</TD><TD>12</TD></TR>
<% Do While Not MatrixData.EOF %>
<% MatrixFarve = MatrixData("Farve") %>
<% MAtrixSize = 6 %>
<TR><TD><%= MatrixData("Farve") %></TD>
<% Do While Not MatrixData.EOF %>
<% If MatrixFarve = MatrixData("Farve") Then %>
<% Select Case (MatrixData("Size") - MatrixSize) %>
<% Case 4 %>
<TD></TD><TD><%= MatrixData("Size") %></TD>
<% Case 6 %>
<TD></TD><TD></TD><TD><%= MatrixData("Size") %></TD>
<% Case Else %>
<TD><%= MatrixData("Size") %></TD>
<% End Select %>
<% Else %><TR><% Exit Do End If %>
<% MatrixFarve = MatrixData("Farve") %>
<% MatrixSize = MatrixData("Size") %>
<% MatrixData.MoveNext %>
<% Loop %>
<% If Not MatrixData.EOF Then MatrixData.MoveNext %>
<% Loop %>
</TABLE>
<% MatrixData.Close %>
<% DataAccess.Close %>
I kan hente det hele på
http://www.danez.dk/eksperten/matrix.zip