I'm having difficulties querying cfldap - I hope someone can help. I have the
following code
<cfldap action="query"
name="getaccount"
start="ou=Live,ou=User Accounts,DC=internal,DC=westminster,DC=gov,DC=uk"
maxrows="10"
attributes="cn,sAMAccountName"
filter="sAMAccountName=#user#"
server="xx.xx.xx.xx"
username="INTERNAL\username"
password="password">
I firstly get the variable "#user#" from the user's userid like this:
<cfset domain = ListGetAt(get_userid.userid, "1", "\,/")>
<cfset user = ListGetAt(get_userid.userid, "2", "\,/")>
and then insert it into the cfldap query. Thing is it doesn't work - doesn't
error or anything. However, if I was to go:
<cfset user = "xxxxx"> where xxxxx is the actual userid of the user it works
fine. Have tried using cfparam and got nothing but beyond this I have run out
of ideas. Anyone help would be appreciated.
Thanks from the UK
Kev in the UK - 22 Nov 2007 10:23 GMT
I know it's only one day but I'm a bit disappointed with the response - surely
someone out there has come across this before? In case there's any
misunderstanding
get_userid.userid is "domainname\userid".
If anybody has an idea and they need more info let me know.
Kev in the UK - 30 Nov 2007 12:29 GMT
Probably such a simple solution everybody deigned it below them. Should have
stuck it in the "Getting started" forum. Anyway the answer was that my
variable was recorded as a char in the sql database - simply changing it to
nvarchar gave me the results I was after.