Anyway to call it on a cfm page it should be just a case of using that reference you've put in onApplication. Ie
<cfquery name="myQuery" datasource="#application.dsn#">
Select ID from myDBTable
</cfquery>
or do you mean something else?
By the way application variables are values persisted in memory throughout the life of the application. They don't relate to sessions which are used for each visitor to your application.
DNS means something completely different so it's best to get terminology right to avoid confusion.
Have you defined a name for your application? It sounds like ColdFusion might be rebuild the application on every request.
At the top of the Application.cfc place this:-
<cfset this.applicationame = "myApplication" >
There are a few more settings that you can define here but look those up on Adobe's online docs.
You don't need the DNS1 = "#application.dsn#" either. All your doing here is duplicating variables. Just use application.dsn directly and it's less for you to manage / remember then :-)
Thanks a lot for the follow up and for the correction. You are right better using the right terminology..
I am using dsn instead.... i think was just a typo ...
I have build a new test page where i have to test that #application.dsn# and it is working just fine..
Bookmarks