ASP Syntax

Aleks
Aleks used Ask the Experts™
on
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

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
I guess you need this??

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

Open in new window

Author

Commented:
With that code is there no need to compare with a null ?
Ryan ChongSoftware Team Lead

Commented:
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")
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Author

Commented:
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

Author

Commented:
This seems to have worked:

if Session("QFBlobid") = "" OR isNull (rs_Blob("Blobdata"))  then
Ryan ChongSoftware Team Lead

Commented:
ok, coool. so do you still need further assistance here?

Author

Commented:
I want to make sure this will work not only if the field is NULL but also if it is 'empty'  meaning  ""
Ryan ChongSoftware Team Lead

Commented:
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

?

Author

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

error '80020009'
Software Team Lead
Commented:
if you do a:
response.write("|" & rs_Blob("Blobdata") & "|")

Open in new window

what do you get?

Author

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

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

Author

Commented:
Thanks for the follow up.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial