Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RecordSet Field Empty 1

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
0
0
US
Guys,

I have created a recordset using a LEFT OUTER JOIN to join together three tables. I have four fields in the recordset. As a result of the outer join, it is possible for one of the fields to contain no data. What I need to know is how to check if the field does not exist for a particular record.

I have tried:

if rs.Fields("GTYCOM") = "" then....
else.....

But it always goes into the else clause even if the field is empty. Any ideas?? Mise Le Meas,

Mighty :)
 
try Response.Writing("[" & rs.Fields("GTYCOM") & "]")
and make sure that it is indeed empty.

-Jas
 
You can also use the isNull(value) function --

returns a simple true or false

:)
 
There's also

if IsEmpty(FieldName) then
or if IsNulll(FieldName) then

It will assume you mean "If IsEmpty(fieldName) = true then" unless you specify otherwise.

I usually put all three in, i.e:

If fieldName = "" or IsEmpty(FieldName) or IsNull(FieldName) then...

Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top