|
 |
access_asp thread: How to Detect No Value in Form
Message #1 by "Stephen Proctor" <steveproctor@c...> on Sun, 3 Feb 2002 04:52:38
|
|
I am trying to write a program which will only write existing data in the
database if there is something in the HTML form which submits the data.
I'm using the following code, which does not seem to work (in other words,
if there is no data in the form, it still overwrites the database record).
If Not IsNull (Request.Form("SecondDirector")) Then objRS("Director2") =
Request.Form("SecondDirector")
Any suggestions?
Thanks.
Steve
Message #2 by "Zee Computer Consulting" <zee@t...> on Sun, 3 Feb 2002 02:25:20 -0800
|
|
Try using
IF len(trim( ( Request.Form("SecondDirector") )) = 0 THEN
instead, because "Null" means a variable or object doesn't exist, not that
it is empty.
-- Z
----- Original Message -----
From: "Stephen Proctor" <steveproctor@c...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, February 03, 2002 4:52 AM
Subject: [access_asp] How to Detect No Value in Form
> I am trying to write a program which will only write existing data in the
> database if there is something in the HTML form which submits the data.
> I'm using the following code, which does not seem to work (in other words,
> if there is no data in the form, it still overwrites the database record).
>
> If Not IsNull (Request.Form("SecondDirector")) Then objRS("Director2")
> Request.Form("SecondDirector")
>
> Any suggestions?
>
> Thanks.
>
> Steve
$subst('Email.Unsub').
Message #3 by "Zee Computer Consulting" <zee@t...> on Sun, 3 Feb 2002 11:42:26 -0800
|
|
Correction: In your example, you would use the "not equals" version:
IF len(trim( ( Request.Form("SecondDirector") )) <> 0 THEN
instead, because "Null" means a variable or object doesn't exist, not that
it is empty.
-- Z
----- Original Message -----
From: "Stephen Proctor" <steveproctor@c...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, February 03, 2002 4:52 AM
Subject: [access_asp] How to Detect No Value in Form
> If Not IsNull (Request.Form("SecondDirector")) Then objRS("Director2")
> Request.Form("SecondDirector")
Message #4 by "Ken Schaefer" <ken@a...> on Mon, 4 Feb 2002 10:08:38 +1100
|
|
Not exactly. NULL actually means something is unknown or undefined, not that
it doesn't exist.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Zee Computer Consulting" <zee@t...>
Subject: [access_asp] Re: How to Detect No Value in Form
: Correction: In your example, you would use the "not equals" version:
:
: IF len(trim( ( Request.Form("SecondDirector") )) <> 0 THEN
:
: instead, because "Null" means a variable or object doesn't exist, not that
: it is empty.
:
: -- Z
:
:
:
:
: ----- Original Message -----
: From: "Stephen Proctor" <steveproctor@c...>
: To: "Access ASP" <access_asp@p...>
: Sent: Sunday, February 03, 2002 4:52 AM
: Subject: [access_asp] How to Detect No Value in Form
:
:
: > If Not IsNull (Request.Form("SecondDirector")) Then objRS("Director2")
: > Request.Form("SecondDirector")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |