Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced Application Variable Help...

Status
Not open for further replies.

BFreshour

Programmer
Mar 20, 2002
84
I'm building application variables dynamically like this:

Code:
<cfset applicationVariable = &quot;application.&quot; & #Left(Replace(Trim(SetClientVars.ClientName), &quot; &quot;, &quot;&quot;, &quot;All&quot;), 5)# & #SetClientVars.ClientID#>

<cfset tempQuery = queryNew(&quot;DSN&quot;)
<cfset temp = QueryAddRow(tempQuery)>
<cfset temp = QuerySetCell(tempQuery, &quot;DSN&quot;, #SetClientVars.DSN#)>

<cfset &quot;#applicationVariable#&quot; = tempQuery>

This works just fine and when I call the variables (for instance the one above) using #application.crite1.dsn# everything works fine.

Now this is where it gets complex... When a user logs in, it pulls their ClientID and ClientName so that it knows which application.(whatever) to use... I can't get this working properly. This is what I have so far....

Code:
<cfset session.ClientApp = #Left(Replace(Trim(GetAppVars.ClientName), &quot; &quot;, &quot;&quot;, &quot;All&quot;), 5)# & #GetAppVars.ClientID#>

Now essentially I'd like to be able to say (I know this wouldn't work, but its theory) #application.#sessionClientApp#.DSN# and pull the DSN for this particular user...

Please help!
 
Someone in #coldfusion on EFNET was able to help me out. Here's the solution...

Code:
#Evaluate(&quot;application.&quot; & session.ClientApp & &quot;.DSN&quot;)#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top