BFreshour
Programmer
- Mar 20, 2002
- 84
I'm building application variables dynamically like this:
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....
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!
Code:
<cfset applicationVariable = "application." & #Left(Replace(Trim(SetClientVars.ClientName), " ", "", "All"), 5)# & #SetClientVars.ClientID#>
<cfset tempQuery = queryNew("DSN")
<cfset temp = QueryAddRow(tempQuery)>
<cfset temp = QuerySetCell(tempQuery, "DSN", #SetClientVars.DSN#)>
<cfset "#applicationVariable#" = 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), " ", "", "All"), 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!