database troubles (Full Version)

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



Message


Topic Starter -> database troubles (3/14/2001 23:16:00)

Anyone know why this won't work?? I have 2 records in the database, one with an answer, one without. I am getting YES for both...

<td>
<% IF FP_FieldVal(fp_rs,"Answer") = "" THEN %>
<font size="2">Not answered
<% ELSE %>
Yes
<% END IF %> </font>
</td>

Thanks!!





Spooky -> RE: database troubles (3/15/2001 20:02:00)

The function "FP_FieldVal" returns a blank space and not a "" as expected

This is to prevent table cells collapsing and no end of frustration for you

Look for "&nbsp;" and not ""

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





hzarabet -> RE: database troubles (3/21/2001 16:50:00)

So if my statement is:

<% IF FP_FieldVal(fp_rs,"Other_terms") = " " THEN (what do I put here so the field will not disply of null) end if%>

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





Topic Starter -> RE: database troubles (3/21/2001 17:05:00)

<% IF FP_FieldVal(fp_rs,"Other_terms") <> " " THEN %>
[display what you want to display]
<% END IF %>





hzarabet -> RE: database troubles (3/22/2001 16:02:00)

That's the thing, I want NOTHING to appear. I want the field, header evreything to collapse if it is null. I have a long list of items. Of the twenty or so items, 15 may be blank. I would only like the 5 items with data to show up.

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





Spooky -> RE: database troubles (3/22/2001 17:37:00)

<% IF FP_FieldVal(fp_rs,"Other_terms") <> "&nbsp;" THEN %>
[display what you want to display]
<%Else%>
[display what you dont want to display:]
<% END IF %>
Either way it will display something or nothing




hzarabet -> RE: database troubles (3/22/2001 23:46:00)

Here is the (rough version) of the database I'm talking about. I want all the empty fields to "disappear" so just the fields with info remain

http://www.signingshotline.com/mailtest.asp?promoter=*mike%20riccio%20sports,%20llc

The info you gave me will get rid of the field names? Am I going to have to enter this 20 or so times for each field?

Thanks in advance Spooky

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada

[This message has been edited by hzarabet (edited 03-23-2001).]





hzarabet -> RE: database troubles (3/23/2001 15:12:00)

I guess what I don't understand is the [display what you dont want to display:]portion. How do I tell it NOT to display a field if it is blank?

There really should be an option for this in the DRW. To only display fields with results in them.

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





Spooky -> RE: database troubles (3/23/2001 15:19:00)

Yep, for each field

<% IF FP_FieldVal(fp_rs,"Other_terms") <> " " THEN %>
[display what you want to display]
<% END IF %>

Now the display part must be the complete TABLE row used "<tr><td>column 1</td><td>Column data</td></tr>"

If the data is empty , you want to not display the whole row

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





hzarabet -> RE: database troubles (3/23/2001 15:20:00)

Thanks Spooky. I was afraid that was your answer.

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





hzarabet -> RE: database troubles (3/25/2001 20:04:00)

Error message. I have never placed HTML into an If...Then statement. Here is the poorly written statement:

<% If FP_FieldVal(fp_rs,"YourBall") <> " " then response.write "<tr>
<td><b><font face="Arial" size="2">YourBall:</font></b></td>
<td><font face="Arial" size="2">
</font></td>
</tr>" else response.write " " end if%>

and here is the error:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/mailtest2.asp, line 68

If FP_FieldVal(fp_rs,"YourBall") <> " " then response.write "<tr>
-----------------------------------------------------------------^

I have gotta go to class and learn this stuff

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada

[This message has been edited by hzarabet (edited 03-25-2001).]





Spooky -> RE: database troubles (3/25/2001 15:21:00)

Always keep " out of your response.write html.

Asp thinks you have finished and looks for another statement

so :
<font face="Arial" size
would become :
<font face='Arial' size





hzarabet -> RE: database troubles (3/27/2001 21:53:00)

Not as easy as you think! Here is the statement:

<%If FP_FieldVal(fp_rs,"Other_terms") <>"" then response.write '<tr>
<td><b><font face='Arial' size='2'>Other_terms:</font></b></td>
<td><font face='Arial' size='2'> FP_FieldVal(fp_rs,'Other_terms')
</font></td>
</tr>' else response.write "" end if%>

And here is the error:

Microsoft VBScript compilation error '800a0400'

Expected statement

/mailtest_copy(1).asp, line 169

<td><b><font face='Arial' size='2'>Other_terms:</font></b></td>

There should be an option in the DRW to drop and field if it is empty

Thanks again Spooky

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





Spooky -> RE: database troubles (3/27/2001 22:58:00)

All of these ' EXCEPT the first and last ones!

<%If FP_FieldVal(fp_rs,"Other_terms") <>"" then
response.write "<tr><td><b><font face='Arial' size='2'>Other_terms:</font></b></td>
<td><font face='Arial' size='2'>"&FP_FieldVal(fp_rs,'Other_terms')&"</font></td>
</tr>"
else
response.write ""
end if%>





hzarabet -> RE: database troubles (3/27/2001 23:05:00)

Here's the error for that one:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/mailtest_copy(1).asp, line 169

response.write "<tr><td><b><font face='Arial' size='2'>Other_terms:</font></b></td>

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





hzarabet -> RE: database troubles (3/28/2001 16:31:00)

Help...I'm sinking




Vince from Spain -> RE: database troubles (3/28/2001 16:42:00)

Hi hzarabet . . .
these 3 lines in the answer by Spooky . . .

response.write "<tr><td><b><font face='Arial' size='2'>Other_terms:</font></b></td>
<td><font face='Arial' size='2'>"&FP_FieldVal(fp_rs,'Other_terms')&"</font></td>
</tr>"

Are actually just one line broken up by being displayed in the forum. Make them one line and everything will be ok

Vince





hzarabet -> RE: database troubles (3/28/2001 17:07:00)

Yep, it worked EXCEPT I had to put our friend "& nbsp;" in instead of ""

------------------
www.Signingshotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada





Vince from Spain -> RE: database troubles (3/28/2001 17:10:00)

ok, so . . .
Make them one line and ALMOST everything will be ok

Vince

------------------
Internet Business Solutions S.L.(Spain)





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.203125