Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / November 2007



Tip: Looking for answers? Try searching our database.

Setting a variable to query cfldap

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kev in the UK - 21 Nov 2007 18:19 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.