you have to place your var scoped variables at the top of the function. in this case, you'd do something like:
<cfset var givenname = "" /> <cfset var sn = "" /> <cfset var mail = "" /> (etc) above your <cfldap> call. On 5/14/07, John P <[EMAIL PROTECTED]> wrote: > I am attempting to use cffunction to query a database and then cfset the > returned variables to a new names. I get the following error when attempting > to access the page. > > "Local variable givenname on line 19 must be grouped at the top of the > function body." > > > Here's my function that appears on my .cfc page: > > <cfldap action="query" > name="GetIDS" > start="ou=ple,o=blah.com" > filter="id=#userID#" > > attributes="givenname,sn,mail,dbaddress,dbcity,dbstate,dbzipcode,homephone" > server="ds.blah.com" username="uid=asdf,ou=ReadOnly,o=blah.com" > password="password" > > > > <cfset var givenname = "First_name"> > <cfset var sn = "Last_Name"> > <cfset var mail = "Addr"> > <cfset var dbaddress = "ADDRESS"> > <cfset var dbcity = "City"> > <cfset var dbstate = "State"> > <cfset var dbzipcode = "ZIP"> > <cfset var homephone = "PHONE"> > > > <cfreturn GetIDS> > > </cffunction> > > What am I doing wrong? Is it possible to use cfset inside of a cffunction? > > Thanks! > > John > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278100 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

