<%very ify%> One of those days (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


mar0364 -> <%very ify%> One of those days (7/26/2006 11:34:08)

I've used this script a million times and it works. Can anyone suggest a tweak? If something is there read it, if not do nothing.
<% IF Trim(rstProverOnly("contactname"))&"" = "" Then 
	'do nothing 
	ELSE
 %>
<tr>
<td class="content" align="left"><strong>Contact</strong> </td>
<td class="content">
<%=(rstProverOnly.Fields.Item("contactname").Value)%>
</td>
</tr>
<% End If %>


Thanks!
Rich




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 12:38:53)

quote:

<% IF Trim(rstProverOnly("contactname"))&"" = "" Then


Try this:

Trim(rstProverOnly("contactname")&"")




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 12:58:15)

No dice brother. Its the little things that drive you over the edge.




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 13:01:01)

What specifically is it doing (or not doing as the case may be)? Any error messages?




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 13:07:51)

It ignores the vb and just reads the blank field and title to the page.




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 13:11:56)

So it treats it as if it were *not* blank but yet returns blank results?

If so, why not this:

<%=(rstProverOnly.Fields.Item("contactname").Value)%>

be this:

<%=rstProverOnly("contactname")%>

If not, maybe I'm dense and you need to explain what is actually returned vs. what you expect. [&o] [:D]




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 13:22:00)

If the field is empty it should not read the row to the page. The field is empty and it reads the row to the page as if the field had content.





rdouglass -> RE: <%very ify%> One of those days (7/26/2006 13:30:27)

Have you looked at the DB closely?

I have seen situations where there is a &nbsp; writtent to the DB and is *not* a space. Hence it will be not blank but yet write nothing to the screen except a space. Maybe you can view source to confirm that the &nbsp; is not being written or confirm the DB.

Just a guess.




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 13:32:03)

I'll try that now.




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 13:38:20)

I tried that and it didn't work. In the DB the field value is null.




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 13:40:41)

quote:

In the DB the field value is null.


And this didn't work? (with the &"" inside the parens?)

Trim(rstProverOnly("contactname")&"")

...and will it work if you put a space in that 1 record just as a test?




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 13:50:46)

I placed a space in the field and it did what its been doing to this point. So I went back to the field and did a back space to delete the space I placed in the field. Now it works. But that would mean I would have to change the default value of those fields. What are your thoughts?

Thanks!
Rich




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 13:54:24)

How 'bout trying this one instead:

IF (Trim(rstProverOnly("contactname")&"") = "") OR IsNull(rstProverOnly("contactname")) THEN

That any better?




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 14:04:30)

That doesn't work.




rdouglass -> RE: <%very ify%> One of those days (7/26/2006 14:35:36)

Something is missing. I don't know what but something is missing. There is no reason that my most recent post shouldn't pick that up.

Have you triple-checked for typos?




mar0364 -> RE: <%very ify%> One of those days (7/26/2006 14:39:00)

I just got pissed and printed out all the code and went over it line by line. Turns out I mistakenly hit the paste button and copied the form twice into the same page.

Thanks for helping me through this.

Rich




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
7.788086E-02