Before the code snippet, PARAM the 'username' variable, defaulting it to some conspicuous like "start-username". Then try running it again and let us know what happens.
william -----Original Message----- From: "Mike | NZSolutions Ltd" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: 9/29/2007 6:28 PM Subject: Creating randon username error Hi guys, Am getting a strage error. Running the code below, I get a value of 'INVALID' inserted into my username column (MSSQL) rather that something like 'LIK2007'? Can any one see what I may be doing worng? <!--- set default username and password ---> <cfset valid_username = false> <cfloop condition="valid_username EQ true"> <cfset username = trim(left(uCase(arguments.lname), 3)) & randRange(1000, 9999)> <cfset getUser = getUser(username=username)> <cfif getUser.recordcount EQ 0> <cfset valid_username = true> </cfif> </cfloop> Thanks heaps Mike ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289807 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4