|
-
Aug 15th, 2004, 07:48 PM
#1
Thread Starter
Giants World Champs!!!!
ASP and/or HTML Table Question **Resolved**
I just started playing around with ASP and I am able to display data from a MS SQL db. One question I have that some of the rows from my query have fields that have either null or "" values. When these rows are displayed in the table the borders for those fields are not printed. I have tried appending and empty string to each field but to no avail.
Here is my Code:
VB Code:
Do While Not rstSimple.EOF
%>
<tr>
<td><%= rstSimple.Fields("Incident_Type").Value%></td>
<td><%= rstSimple.Fields("Filenum").Value%></td>
<td><%= rstSimple.Fields("CASENUM").Value%></td>
<td><%= rstSimple.Fields("STATUS").Value%></td>
</tr>
<%
rstSimple.MoveNext
Loop
Last edited by Mark Gambo; Aug 16th, 2004 at 12:18 PM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 16th, 2004, 01:22 AM
#2
Check for a null value, and if it's null, print an instead.
-
Aug 16th, 2004, 01:22 AM
#3
^--- that. Didn't show up in the first post.
-
Aug 16th, 2004, 08:06 AM
#4
Thread Starter
Giants World Champs!!!!
One more question....
Thanks, that did the trick. I just added it after each field:
VB Code:
<TD><%=rstSimple.Fields("Incident_Type").Value%> %nbsp</TD>
Are there any problems with the above code?
Can I use the IIF() command to check for a null value?
Thanks,
(Sent from my Treo 600)
Last edited by Mark Gambo; Aug 16th, 2004 at 08:40 AM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 16th, 2004, 08:55 AM
#5
Fanatic Member
use
VB Code:
<%
if trim(rstSimple.Fields("Incident_Type").Value) = "" then
response.write " "
else
response.write rstSimple.Fields("Incident_Type").Value
end if
%>
-
Aug 16th, 2004, 11:15 AM
#6
Thread Starter
Giants World Champs!!!!
Hyperlinks and Fields
mendhak and DaveBat,
Thank you very much. Your posts were right on the money.
One last question and I promise this is it. In the table I am displaying Serial Numbers, and I want the user to be able to click on the serial number (Hyperlink) and then load another page. I tried this:
VB Code:
<TD><%=rstSimple.Fields("Incident_Type").Value%> %nbsp <A HREF =rstSimple.Fields("Incident_Type").Value </a></TD>
But I am getting an error. Any suggestions?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 16th, 2004, 12:18 PM
#7
Thread Starter
Giants World Champs!!!!
I figured it out!!
I figure it out:
VB Code:
<TD><A HREF="NotInstalled.HTM"><%=rstSimple.Fields("Incident_Type").Value%></A></TD>
Thanks Again!!!
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|