Skifte farve for hver record - virker ik!
Jeg prøver at skifte td bgcolor for hver record jeg læser ud...men hvorfor virker det ik ?Eller hvis I har et bedre forslag vil jeg gerne have det. Det skal dog forklares eller vises udførligt da jeg ikke er en haj..
<% Session.LCID=1030 %>
<html>
<head>
<title>Update Entry Select</title>
<link rel="stylesheet" type="text/css" href="fiskestil.css">
</head>
<body bgcolor="#F9F9F9" text="black">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="530" id="AutoNumber2">
<tr>
<td width="100%">
<p align="center">
<font face="Verdana" size="2">
<strong>
Fangstrapporter</strong></font></p>
</td>
</tr>
<tr>
<td width="100%">
<hr width="530px">
</td>
</tr>
</table>
</center>
</div>
<br>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/krcDB.mdb")
'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT testtabel.* FROM testtabel;"
'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon
'Loop through the recordset
Do While not rsGuestbook.EOF
Rad = 1
%>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" width="530px">
<%
If (Rad mod 2) = 1 Then
BGFarge = "#ffffff"
Else
BGFarge = "#eeeeee"
End If
Rad = Rad + 1
%>
<tr>
<td width="15%" bgcolor=<%=BGFarge%>>
<%
Response.write "<FONT size=1 face=verdana>" & rsguestbook("dato") & "</FONT>"
%>
</td>
<td width="65%" bgcolor=<%=BGFarge%>>
<%
Response.Write ("<a href=""update_form.asp?ID=" & rsGuestbook("ID_no") & """>")
Response.Write (rsGuestbook("fangst"))
Response.Write ("</a>")
%>
</td>
<td width="20%" bgcolor=<%=BGFarge%>> <%
Response.write "<FONT size=1 face=verdana>" & rsguestbook("forfatter") & "</FONT>"
%>
</td>
</tr>
</table>
</div>
<%
'Move to the next record in the recordset
rsGuestbook.MoveNext
Loop
'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
</body>
</html>
