Oh yeah, that seems to be working.. sort of!
I have tried MyQuery['one'][1] and it seems to retrieve the correct data but when I try to access MyQuery['this-hyphen'][1], I get the following error message:
The member "THIS-HYPHEN" in dimension 1 of object "MyQuery" cannot be found. Please, modify the member name.
This comes to following conclusions:
1. CFLDAP is not retrieving "this-hyphen" attribute properly due to hyphen in its name
2. "this-hyphen" does not exist in AD.
For point 1, I would of thought that it is OK to put hyphen in attribute list because it is passing the string.
For point 2, I just tried to bring in RANDOM attribute that does not exist in AD (eg ASWEQ), and it doesn't seem to throw any error when I try to access that attribute in CFSET.
So what exactly is going on here?
This comes to following conclusions: 1. CFLDAP is not retrieving "this-hyphen" attribute properly due to hyphen in its name 2. "this-hyphen" does not exist in AD. For point 1, I would of thought that it is OK to put hyphen in attribute list because it is passing the string.
|
I can't vouch for how the remote directory will react to being asked for an attribute that doesn't exist... one would need to read the LDAP spec for that I guess. I'm not gonna ;-)
However how the diectory system handles it is irrelevant, to a point. You're code should busy itself with what gets delivered back to you. So you don't even know if your returned query even has this column in it? Wouldn't that be a good place to start? Have you dumped the query out and checked?
I do know that <cfldap> itself has no problems with attributes with hyphenated names. Well when I went through all this a few years ago (following similar steps to what we're doing here ;-) the data came back fine.
For point 2, I just tried to bring in RANDOM attribute that does not exist in AD (eg ASWEQ), and it doesn't seem to throw any error when I try to access that attribute in CFSET. So what exactly is going on here? |
OK, well I suppose that answers my question above. ADS will echo back any (?) attribute you ask for, with just a blank value if it doesn't exist. I doubt it would act any differently for hyphenated names, but this is easily answered by dumping out your query and seeing what you've got. Is it there?
What happens if you query for a valid attribute with a hyphen in the name? I'm not sure there's much merit querying for stuff that doesn't exist...
--
Adam