Avatar of Aleks
Aleks
Flag for United States of America asked on

ASP Syntax

This should be an easy one. I am not on my desktop so I cant make sure this is the correct syntax of the following IF, can someone please confirm it is so I can pass it to a collegue ?

Current code is:

if Session("QFBlobid") = "" OR rs_Blob("Blobdata") = "" then

REGION A

	If not rs_FormsBlb.EOF then

REGION B 

	else
		Response.Write("Error EOF")
	end if
end if

%>

Open in new window


That code works well, but I need to add to the first IF. I want to run REGIONS IF that blob session doesn't exist, but also if a field of the recordset "rs_blob" is = ""  OR is NULL

This is how I entered the code, unfortunately I can't confirm at this time, can someone tell me if it looks correct ?

if Session("QFBlobid") = "" OR rs_Blob("Blobdata") = "" then  OR OR rs_Blob("Blobdata") is NULL

REGION A
... etc

Open in new window

Web DevelopmentASPSQL

Avatar of undefined
Last Comment
Aleks

8/22/2022 - Mon
Ryan Chong

I guess you need this??

if Session("QFBlobid") = "" OR "" & rs_Blob("Blobdata") = "" then
'....

Open in new window

Aleks

ASKER
With that code is there no need to compare with a null ?
Ryan Chong

as it was using:

"" & rs_Blob("Blobdata")

it will cover up the comparison with null value.

meaning to say, even rs_Blob("Blobdata") contains null value, it will be replaced with "" as we using:

"" & rs_Blob("Blobdata")
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Aleks

ASKER
I apologize for the wait. I added:

if Session("QFBlobid") = "" OR "" & rs_Blob("Blobdata") = "" then

Open in new window


I get this error on that line:


error '80020009'
/bluedot/Intranet/Cases/forms_bridgecall.asp, line 1061


line 1061 is:   if Session("QFBlobid") = "" OR "" & rs_Blob("Blobdata") = "" then

Note: Blobdata is a text field
Aleks

ASKER
This seems to have worked:

if Session("QFBlobid") = "" OR isNull (rs_Blob("Blobdata"))  then
Ryan Chong

ok, coool. so do you still need further assistance here?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Aleks

ASKER
I want to make sure this will work not only if the field is NULL but also if it is 'empty'  meaning  ""
Ryan Chong

I want to make sure this will work not only if the field is NULL but also if it is 'empty'  meaning  ""
what if we try:
if Session("QFBlobid") = "" OR isNull (rs_Blob("Blobdata")) or rs_Blob("Blobdata") = "" then

Open in new window

?
Aleks

ASKER
I tried but I get the error I posted before:

error '80020009'
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Ryan Chong

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Aleks

ASKER
Actually this seems to have worked on every scenario we tried:

if Session("QFBlobid") = "" OR isNull (rs_Blob("Blobdata"))  then
Aleks

ASKER
Thanks for the follow up.