Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Show if DB field NOT NULL (http://www.velocityreviews.com/forums/t795347-show-if-db-field-not-null.html)

Keith 07-09-2004 10:39 PM

Show if DB field NOT NULL
 
What is the correct code to use to hide a section if a specific DB field is
NULL.

Thanks



Dave Anderson 07-10-2004 01:29 AM

Re: Show if DB field NOT NULL
 
"Keith" wrote:
> What is the correct code to use to hide a section if a specific DB
> field is NULL.


Define "hide a section".


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.



Jeff Cochran 07-10-2004 04:20 AM

Re: Show if DB field NOT NULL
 
On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:

>What is the correct code to use to hide a section if a specific DB field is
>NULL.


Hide a section as in using DHTML to hide/unhide? Try a DHTML group
for that answer.

If you're looking for an ASP-only answer:

IF DBField <> Null Then
Response.Write "Hidden Section"
End If

Jeff

Keith 07-10-2004 12:34 PM

Re: Show if DB field NOT NULL
 
Sorry - badly written question.

Hide a section as in don't process a section of the page if a DB field is
NULL

"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> wrote in message
news:40ef4669$0$235$a1866201@newsreader.visi.com.. .
> "Keith" wrote:
> > What is the correct code to use to hide a section if a specific DB
> > field is NULL.

>
> Define "hide a section".
>
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message.

Use
> of this email address implies consent to these terms. Please do not

contact
> me directly or ask me to contact you directly for assistance. If your
> question is worth asking, it's worth posting.
>
>




Bob Barrows [MVP] 07-10-2004 12:50 PM

Re: Show if DB field NOT NULL
 
Jeff Cochran wrote:
> On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:
>
>> What is the correct code to use to hide a section if a specific DB
>> field is NULL.

>
> Hide a section as in using DHTML to hide/unhide? Try a DHTML group
> for that answer.
>
> If you're looking for an ASP-only answer:
>
> IF DBField <> Null Then
> Response.Write "Hidden Section"
> End If
>
> Jeff

Minor correction:
IF Not DBField Is Null Then

or

If IsNull(DBField) = False Then

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Jeff Cochran 07-10-2004 06:23 PM

Re: Show if DB field NOT NULL
 
On Sat, 10 Jul 2004 08:50:10 -0400, "Bob Barrows [MVP]"
<reb01501@NOyahoo.SPAMcom> wrote:

>Jeff Cochran wrote:
>> On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:
>>
>>> What is the correct code to use to hide a section if a specific DB
>>> field is NULL.

>>
>> Hide a section as in using DHTML to hide/unhide? Try a DHTML group
>> for that answer.
>>
>> If you're looking for an ASP-only answer:
>>
>> IF DBField <> Null Then
>> Response.Write "Hidden Section"
>> End If
>>
>> Jeff

>Minor correction:
>IF Not DBField Is Null Then
>
>or
>
>If IsNull(DBField) = False Then


Bleh! Should stop answering posts at 2:00 am... :)

Especially since I just ran through an IsNull() programming section
during the day.

Jeff

Jeff Cochran 07-10-2004 06:25 PM

Re: Show if DB field NOT NULL
 
On Sat, 10 Jul 2004 13:34:28 +0100, "Keith" <@.> wrote:

>Sorry - badly written question.
>
>Hide a section as in don't process a section of the page if a DB field is
>NULL


You can't "not process a page" because until you process the page you
can't determine if the field is null. You can branch based on it
being null, or else you'll need to use two pages, or try to accomplish
a conditional include, which is more work thatn the system should do.

Jeff

>"Dave Anderson" <GTSPXOESSGOQ@spammotel.com> wrote in message
>news:40ef4669$0$235$a1866201@newsreader.visi.com. ..
>> "Keith" wrote:
>> > What is the correct code to use to hide a section if a specific DB
>> > field is NULL.

>>
>> Define "hide a section".
>>
>>
>> --
>> Dave Anderson
>>
>> Unsolicited commercial email will be read at a cost of $500 per message.

>Use
>> of this email address implies consent to these terms. Please do not

>contact
>> me directly or ask me to contact you directly for assistance. If your
>> question is worth asking, it's worth posting.
>>
>>

>



Binoj Antony 07-12-2004 12:07 PM

Re: Show if DB field NOT NULL
 
IF (NOT ISNULL(DBField)) THEN
' Do something
ELSE
' Do Something else
END IF

This works best for me...


All times are GMT. The time now is 01:04 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57