jjr0319
07-27-2005, 02:15 PM
im creating an ASP page with Access as the backend (don't laugh). anyway, i want to display a set of records in a particular table. it's working fine, but i want each subsequent record to have a different CSS style so it's easier to read and distinguish between records. here's what i have working so far:
<%
Dim rs
Dim strSQL
Dim curr
Dim outstring
Dim header
Dim spacer
spacer = " "
datetrail=""
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=d:\inetpub\wwwroot\subs\testcfms\actlogs.mdb;User
Id=admin;Password=;"
conn.Open
strSQL = strSQL & "SELECT ARMY.[REQUESTED_BY], "
strSQL = strSQL & "ARMY.[REQUESTED_OF], "
strSQL = strSQL & "ARMY.[MILITARY_SERVICE], "
strSQL = strSQL & "ARMY.[SUBJECT_TOPIC], "
strSQL = strSQL & "ARMY.[STATUS], "
strSQL = strSQL & "ARMY.[COMMENTS] "
strSQL = strSQL & "FROM ARMY"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL, conn, adOpenKeyset, adLockOptimistic
if rs.BOF and rs.EOF then
response.write "<b>Click on your browser's <b><I>Back</I></B> button to return to the input page."
else
Do While Not rs.EOF
by= rs("REQUESTED_BY")
of= rs("REQUESTED_OF")
service=rs("MILITARY_SERVICE")
subject=rs("SUBJECT_TOPIC")
status=rs("STATUS")
comm=rs("COMMENTS")
%>
<tr>
<td align="left" valign="top" class="????????" width="45%"><b>Date of Request:</b>
<br><b>Due Date:</b>
<br><b>Requested By:</b> <%= by %>
<br><b>Requested Of:</b> <%= of %>
<br><b>Military Service:</b> <%= service %>
<br><b>Subject/Topic:</b> <%= subject %>
<br><b>Status:</b> <font color="#33CC00"><%= status %></font>
<br><b>Follow Up Date:</b>
</td>
</tr>
<%
rs.MoveNext
Loop
End if
rs.Close
conn.Close
Set objRecordset = Nothing
Set objConnection = Nothing
%>
i want the each record <tr> to alternate between class="tabledkblue2" and class="tablegray2".
any help would be greatly appreciated.
thanks in advance.
<%
Dim rs
Dim strSQL
Dim curr
Dim outstring
Dim header
Dim spacer
spacer = " "
datetrail=""
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=d:\inetpub\wwwroot\subs\testcfms\actlogs.mdb;User
Id=admin;Password=;"
conn.Open
strSQL = strSQL & "SELECT ARMY.[REQUESTED_BY], "
strSQL = strSQL & "ARMY.[REQUESTED_OF], "
strSQL = strSQL & "ARMY.[MILITARY_SERVICE], "
strSQL = strSQL & "ARMY.[SUBJECT_TOPIC], "
strSQL = strSQL & "ARMY.[STATUS], "
strSQL = strSQL & "ARMY.[COMMENTS] "
strSQL = strSQL & "FROM ARMY"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL, conn, adOpenKeyset, adLockOptimistic
if rs.BOF and rs.EOF then
response.write "<b>Click on your browser's <b><I>Back</I></B> button to return to the input page."
else
Do While Not rs.EOF
by= rs("REQUESTED_BY")
of= rs("REQUESTED_OF")
service=rs("MILITARY_SERVICE")
subject=rs("SUBJECT_TOPIC")
status=rs("STATUS")
comm=rs("COMMENTS")
%>
<tr>
<td align="left" valign="top" class="????????" width="45%"><b>Date of Request:</b>
<br><b>Due Date:</b>
<br><b>Requested By:</b> <%= by %>
<br><b>Requested Of:</b> <%= of %>
<br><b>Military Service:</b> <%= service %>
<br><b>Subject/Topic:</b> <%= subject %>
<br><b>Status:</b> <font color="#33CC00"><%= status %></font>
<br><b>Follow Up Date:</b>
</td>
</tr>
<%
rs.MoveNext
Loop
End if
rs.Close
conn.Close
Set objRecordset = Nothing
Set objConnection = Nothing
%>
i want the each record <tr> to alternate between class="tabledkblue2" and class="tablegray2".
any help would be greatly appreciated.
thanks in advance.