471,854 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 software developers and data experts.

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
Jul 19 '05 #1
7 24998
"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.
Jul 19 '05 #2
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
Jul 19 '05 #3
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" <GT**********@spammotel.com> wrote in message
news:40*********************@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.

Jul 19 '05 #4
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"
Jul 19 '05 #5
On Sat, 10 Jul 2004 08:50:10 -0400, "Bob Barrows [MVP]"
<re******@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
Jul 19 '05 #6
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" <GT**********@spammotel.com> wrote in message
news:40*********************@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.


Jul 19 '05 #7
IF (NOT ISNULL(DBField)) THEN
' Do something
ELSE
' Do Something else
END IF

This works best for me...
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Peter Neumaier | last post: by
5 posts views Thread by msnews.microsoft.com | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.