navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Blank database results blues

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Blank database results blues
Page: [1]
 
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
Blank database results blues - 12/18/2002 10:52:09   
I am trying to keep the database results page from displaying a blank space when the column value returned was blank.
For example,
<<age>> <<weight>> <<marital_status>>

would produce this: (if there was nothing in the weight column)

27 single

And I wanted to get this:

27 single

Can someone tell me how to do this? I have been trying to figure it out for 2 days!
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 11:08:53   
quote:

would produce this: (if there was nothing in the weight column)

27 single

And I wanted to get this:

27 single


They look the same to me..?


_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 11:30:27   
I meant it would produce this:

27 single
(Two spaces between 27 and single because the weight field was left blank)

Dave

(in reply to bobby)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 12:08:53   
You should be able to substitute anything you like for a blank field... a clear GIF as a placeholder, empty spaces, " Not available" or something to that effect... using an if...then... else statement

<%
if rs(" Weight" ) = " " then
response.write " <p>Not available</p>"
else
response.write rs(" Weight" )
end if
%>

Something like that..?


_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Sandalwood)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 13:14:35   
You could also do it with a table. As long as you have at least a space, you' re tables should be fine across browser types and give you the results you expect (IMO)...

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 13:44:37   
I get a message saying the contents of a frontpage component have been modified and will be overwritten when I save the page, and then the code is deleted?

(in reply to bobby)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 14:09:43   
You have to put the DRW on a Spooky Diet first. Then your code should stay....

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 14:29:06   
I don' t seem to have a lot of that stuff, either that or I can' t find it....

http://www.manningagency.com/slipstream/view.asp?ID=13


(in reply to rdouglass)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 15:04:28   
Sorry, but you gave me a link to a results page. I wouldn' t see any of the FP code here. You' ll need to look at the page in FrontPage under the HTML View tab to see all the FP ' greycode' ....

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 15:25:49   
OK, I was able to delete the ' greycode' but I get a runtime error when I insert bobby' s code.

Any suggestions?

(in reply to rdouglass)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 15:48:36   
Are you replacing my generic rs(" Weight" ) with the proper recordset and field name?


_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 15:57:44   
The record source is named " Results" , which is what I changed the " weight" to, but I still got this error message:

Microsoft VBScript runtime error ' 800a000d'
Type mismatch: ' rs'

Where in the .asp does your code need to go?

(in reply to bobby)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 16:09:34   
bobby' s solution was NOT using the DRW (which I suspect you are). The ' weight' bobby' s referring to is a field name. So if your DRW uses code like:

<%=FP_FieldVal(fp_rs," weight" )%>

then bobby' s solution would look like:

<%
if trim(FP_FieldVal(fp_rs," weight" )) = " " then
response.write " <p>Not available</p>"
else
response.write FP_FieldVal(fp_rs," weight" )
end if
%>

I used trim(FP_FieldVal(fp_rs," weight" )) ' cause Fp usually ' pads' the empty fields with a space. Does that help get you moving?

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 16:22:39   
Well,

I don' t get the error anymore, but I am still not getting " Not Available" returned, just the stupid blank space!


AAAAAAARRRRGHH!

(in reply to rdouglass)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 16:25:47   
Can you post the code between the lines:

<!--#include file=" _fpclass/fpdbrgn1.inc" -->

and:

<!--#include file=" _fpclass/fpdbrgn2.inc" -->

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/18/2002 16:29:17   
Yes

(in reply to rdouglass)
bobby

 

Posts: 11394
Joined: 8/15/1969
From: Seattle WA USA
Status: offline

 
RE: Blank database results blues - 12/18/2002 16:58:22   
<% 
if trim(FP_FieldVal(fp_rs," weight" )) = " "  then 
response.write " <p>Not available</p>"  
else 
response.write " <p>blank</p>" 
end if 
%> 


Try the above... maybe it' s pulling a space out of your db? Shouldn' t, but this way you' ll at least see something come back...

If you get " blank" returned then it could be that you have a blank space or two input into that database field... that should still come back empty, tho.


_____________________________

If con is the opposite of pro, is Congress the opposite of progress?


:)

(in reply to Sandalwood)
rdouglass

 

Posts: 9279
From: Biddeford, ME USA
Status: offline

 
RE: Blank database results blues - 12/19/2002 8:12:10   
quote:

If you get " blank" returned then it could be that you have a blank space or two input into that database field... that should still come back empty, tho.


By default FP returns a space for empty fields. That' s why my code uses ' trim' as well....:)

(in reply to Sandalwood)
Sandalwood

 

Posts: 233
Joined: 12/18/2002
From: New Jersey!
Status: offline

 
RE: Blank database results blues - 12/19/2002 13:50:20   
Hey, that worked! Thanks to all who have helped me. I have been searching for answers on sites and in forums for a couple of days, but this is by far the best forum. I will be back to help out others if I can.

Thanx!

(in reply to bobby)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Blank database results blues - 12/19/2002 14:05:21   
When in doubt, use the plain function FP_Field and not FP_FieldVal.

The true result will be returned.
When FP_FieldVal is used, a space holder " &nbsp;" is placed to prevent table cells collapsing ala netscape.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Sandalwood)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Blank database results blues
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts