Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag 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

Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

I guess you need this??

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

Open in new window

Avatar of Aleks

ASKER

With that code is there no need to compare with a null ?
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")
Avatar of 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
Avatar of Aleks

ASKER

This seems to have worked:

if Session("QFBlobid") = "" OR isNull (rs_Blob("Blobdata"))  then
ok, coool. so do you still need further assistance here?
Avatar of Aleks

ASKER

I want to make sure this will work not only if the field is NULL but also if it is 'empty'  meaning  ""
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

?
Avatar of Aleks

ASKER

I tried but I get the error I posted before:

error '80020009'
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

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

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

ASKER

Thanks for the follow up.