From: Dan on
If I have a query which returns the LDAP data for a user how can I run an
'IF' on whether or not a field exists?

For example
If LDAPFieldX Exists then....
Else
.......

I've tried IsNull and a few others but they don't seem to work.
From: "Steven Cheng" on
Hi Dan,

Generally, for detecting existence of an object or property, you can use
IsNull or IsEmpty as below:

===============
propertyout = ""
prop = Session.Property("SOMEPROPERTY")
If IsNull(prop) Or IsEmpty(prop) Then
' do stuff
Else
propertyout = propertyout+prop
' do other stuff
End If
===================

For LDAP component they're of COM based objects and you can tried directly
access the certain properties and use Error handling code to capture error
in case the property not exist.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg(a)microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

--------------------
>From: =?Utf-8?B?RGFu?= <Dan(a)discussions.microsoft.com>
>Subject: Check 'If LDAP field exists for user then...
>Date: Thu, 4 Mar 2010 16:19:01 -0800

>
>If I have a query which returns the LDAP data for a user how can I run an
>'IF' on whether or not a field exists?
>
>For example
>If LDAPFieldX Exists then....
>Else
>......
>
>I've tried IsNull and a few others but they don't seem to work.
>