Hi Tech!
Thanks in advance for your help. Tek-Tips has always been extremely helpful when I'm expreriencing stumpage.
I have an asp page that connects to a database. Everything works great except for this one table cell on the page.
In the database is a table, tblTravelHistory:
(there are other records in the table, but that's not relevant.)
Here is the output to the table on the asp page:
As you can see, the Notes cell is empty, where the database table shows "initial entry" in the field mfldNotes. This is the problem.
Here is the relevant code for the page:
(there's more to the page, but as it all works great I haven't included it.)
I can't figure it out, especially as I have five other tables on the page that display perfectly with basically the same code, EXCEPT that four of them don't use the InOut array. Why would this one cowardly field and/or table cell stubbornly refuse to show itself?
I humbly turn the problem over to you Tek-Tippers, who have proven yourselves in the past to be much smarter than I.
Thanks in advance for your help. Tek-Tips has always been extremely helpful when I'm expreriencing stumpage.
I have an asp page that connects to a database. Everything works great except for this one table cell on the page.
In the database is a table, tblTravelHistory:
(there are other records in the table, but that's not relevant.)
Here is the output to the table on the asp page:
As you can see, the Notes cell is empty, where the database table shows "initial entry" in the field mfldNotes. This is the problem.
Here is the relevant code for the page:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<style type="text/css">
table.better {
border-collapse: collapse;
padding: 2px;
}
table.better, th.better {
border-style: solid;
border-width: 1px;
border-color: #002B53;
}
tr.better:hover {background-color: #ccddff;}
th.better {
background-color: #2B5BA2;
font-family: arial;
font-size: small;
color: white;
padding: 4px;
}
td.better {
border-style: solid;
border-width: 1px;
border-color: #002B53;
font-family: arial;
font-size: small;
font-weight: bold;
text-align: left;
padding: 4px;
}
td.better0a {
border-style: solid;
border-width: 1px;
border-color: #002B53;
font-family: arial;
font-size: small;
font-weight: bold;
text-align: center;
color: #009900;
padding: 4px;
}
td.better0b {
border-style: solid;
border-width: 1px;
border-color: #002B53;
font-family: arial;
font-size: small;
font-weight: bold;
text-align: center;
color: #FF0000;
padding: 4px;
}
</style>
<%
Dim conn
Dim rs
Dim strSQL
Dim strConnection
Dim idxItems
Dim i
Dim InOut
Dim temp
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
idxItems = rs("idxItems")
InOut = array("IN", "OUT")
Response.Write("<title>" & Session("name") & " Collection</title></head><body style='margin-left: 20px;'>")
conn.Open strConnection
strSQL = "SELECT ynfldInOut, dfldDate, mfldNotes, tfldReference FROM tblTravelHistory " & "WHERE nfldidxItems=" & idxItems & ";"
Set rs = conn.Execute (strSQL)
Response.Write("<table class='better'><caption style='font-family: arial; font-size: small; font-weight: bold; text-decoration: underline;'>Travel History</caption>" & _
"<tr><th class='better'>IN / OUT</th><th class='better'>Date</th><th class='better'>Notes</th><th class='better'>Reference</th></tr>")
rs.MoveFirst
Do While Not rs.EOF
Response.Write ("<tr class='better'>")
For i = 0 to rs.Fields.Count - 1
temp = rs.Fields(i)
If i = 0 Then
If temp + 1 = 0 Then
temp = "0a'>" & InOut(temp + 1)
Else
If temp + 1 = 1 Then
temp = "0b'>" & InOut(temp + 1)
End If
End If
Else
temp = "'>" & rs.Fields(i)
End If
Response.Write("<td class='better" & temp & "</td>")
Next
Response.write("</tr>")
rs.MoveNext
Loop
Response.Write("</table>")
rs.Close
Response.Write("</body></html>")
set rs = Nothing
conn.Close
set conn = Nothing
Response.End
%>
(there's more to the page, but as it all works great I haven't included it.)
I can't figure it out, especially as I have five other tables on the page that display perfectly with basically the same code, EXCEPT that four of them don't use the InOut array. Why would this one cowardly field and/or table cell stubbornly refuse to show itself?
I humbly turn the problem over to you Tek-Tippers, who have proven yourselves in the past to be much smarter than I.