Hej igen,
har nu gjort vissa modifieringar i koden (Johnny, fick ej ngn pli på ditt förslag) :S
Det som händer nu är att sidan säger "Det finns inga resultat!" men jag vet att det finns resultat i db:n eftersom dte kommer fram på denna sida:
http://www.monow.se/borg/mystat/klubb_filt_skarp.asp
men inte på denna sida:
http://www.monow.se/borg/mystat/klubb_filt.asp
lite missvisande namn på filerna kanske eftersom den som heter skarp inte är den som jag arbetar med :D
min db ser ut så här:
tbl_res [Id (räknare, primärnyckel), PlayerId (text), Surface (text), Date (datum/tid), Comp_Name (text), Varv (text), AMT1 (tal), AMT2 (tal), AMT3 (tal), AMT4 (tal), AMT5 (tal), AMT6 (tal), AMT7 (tal), AMT8 (tal), AMT9 (tal), AMT10 (tal), AMT11 (tal), AMT12 (tal), AMT13 (tal), AMT14 (tal), AMT15 (tal), AMT16 (tal), AMT17 (tal), AMT18 (tal), TOTAL (tal)
tbl_player [Id (räknare, primärnyckel), Namn (text), Efternamn (text), PlayerId (text), Visa (ja/nej)
och koden så här:
<%
Sub createNewTableStart(endPrevTable)
if endPrevTable then response.write vbCrLf & "</table>" & vbCrLf & "<br />" & vbCrLf
%>
<table border="1" style="border-collapse: collapse" bordercolor="1px solid #000000">
<tr bgcolor="#CDD5E4" style="font-weight: bold">
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=1" target="top10">1</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=2" target="top10">2</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=3" target="top10">3</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=4" target="top10">4</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=5" target="top10">5</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=6" target="top10">6</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=7" target="top10">7</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=8" target="top10">8</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=9" target="top10">9</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=10" target="top10">10</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=11" target="top10">11</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=12" target="top10">12</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=13" target="top10">13</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=14" target="top10">14</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=15" target="top10">15</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=16" target="top10">16</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=17" target="top10">17</a></td>
<td width="30" align="center"><a href="top10.asp?Show=Top10&Lane=18" target="top10">18</a></td>
<td width="30" align="center">Tot</td>
</tr>
<%
End Sub
%>
<html>
<head>
<title></title>
<style type="text/css">
td {
font-size: 11px;
font-family: verdana;
color: black;
}
a {
text-decoration: none;
}
.blueText {
color:blue;
font-weight: bold;
}
.greenText {
color:green;
font-weight: bold;
}
.redText {
color:red;
font-weight: bold;
}
.blackText {
color:black;
font-weight: bold;
}
</style>
<link rel="stylesheet" type="text/css" href="css/table.css">
</head>
<body>
<%
dim Conn, objrs, i, prevDate, currDate, strTot
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/xlr13x3sm.mdb")
Set objrs = Conn.Execute("SELECT tbl_player.Namn, tbl_player.Efternamn, tbl_res.AMT1, tbl_res.AMT2, tbl_res.AMT3, tbl_res.AMT4, tbl_res.AMT5, tbl_res.AMT6, tbl_res.AMT7, tbl_res.AMT8, tbl_res.AMT9, tbl_res.AMT10, tbl_res.AMT11, tbl_res.AMT12, tbl_res.AMT13, tbl_res.AMT14, tbl_res.AMT15, tbl_res.AMT16, tbl_res.AMT17, tbl_res.AMT18, tbl_res.TOTAL, tbl_res.Date, tbl_res.Comp_Name FROM tbl_player INNER JOIN tbl_res ON tbl_player.PlayerId=tbl_res.PlayerId WHERE tbl_res.Comp_Name='"&strCompName&"' AND tbl_res.Surface ='Filt' ORDER BY tbl_res.Date, tbl_res.Varv")
i=0
while not objrs.BOF and not objrs.EOF
currDate = objrs("Date")
if IsEmpty(prevDate) then 'first iteration
createNewTableStart(false)
elseif prevDate <> currDate then
createNewTableStart(true)
end if
i = i + 1
If i Mod 2 = 0 Then
%>
<tr bgcolor="#EEEEEE">
<% Else %>
<tr bgcolor="#FFFFFF">
<% End If %>
<td align="center"><%=objrs("AMT1")%></td>
<td align="center"><%=objrs("AMT2")%></td>
<td align="center"><%=objrs("AMT3")%></td>
<td align="center"><%=objrs("AMT4")%></td>
<td align="center"><%=objrs("AMT5")%></td>
<td align="center"><%=objrs("AMT6")%></td>
<td align="center"><%=objrs("AMT7")%></td>
<td align="center"><%=objrs("AMT8")%></td>
<td align="center"><%=objrs("AMT9")%></td>
<td align="center"><%=objrs("AMT10")%></td>
<td align="center"><%=objrs("AMT11")%></td>
<td align="center"><%=objrs("AMT12")%></td>
<td align="center"><%=objrs("AMT13")%></td>
<td align="center"><%=objrs("AMT14")%></td>
<td align="center"><%=objrs("AMT15")%></td>
<td align="center"><%=objrs("AMT16")%></td>
<td align="center"><%=objrs("AMT17")%></td>
<td align="center"><%=objrs("AMT18")%></td>
<td align="center">
<%
strTot = objrs("TOTAL")
if strTot < 30 then
response.write "<span class=""blueText"">"&strTot&"</span>"
elseif strTot < 36 then
response.write "<span class=""greenText"">"&strTot&"</span>"
elseif strTot < 40 then
response.write "<span class=""redText"">"&strTot&"</span>"
elseif strTot > 39 then
response.write "<span class=""blackText"">"&strTot&"</span>"
End if
response.write vbCrLf & "</td>" & vbCrLf & "</tr>" & vbCrLf
prevDate = currDate
objrs.movenext
wend
if i=0 then 'empty recordset
response.write "<tr><td colspan=""19"">Det finns inga resultat!</td></tr>"
end if
%>
</table>
<%
'close and kill recordset/connection objects
objrs.close
set objrs = nothing
Conn.close
set Conn = nothing
%>
</body>
</html>
Hoppas någon kan hjälpa mig få ordning på detta.
/S