Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7734113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:10:07+00:00 2026-06-01T07:10:07+00:00

I am trying to convert an application I support from application.cfm to application.cfc. I

  • 0

I am trying to convert an application I support from application.cfm to application.cfc. I followed Ben Nadel’s ColdFusion Application.cfc Tutorial And Application.cfc Reference, but my pages cannot access any of the variables in the APPLICATION scope, without adding APPLICATION. to the variable. As a side note, this application uses 0 cfc’s currently.

here is my application.cfc.

<cfcomponent displayname="Application" hint="Handle the application" output="true">

    <cfset THIS.Name = "AAS" />
    <cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 60, 0 , 0) />
    <cfset THIS.SessionManagement = true />
    <cfset THIS.setClientCookies = false />
    <cfset THIS.versionNum = '1'>
    <cfset THIS.genericUserID = 'o005265'>
    <cfset THIS.genericPassword = 'zo005265'>

    <cffunction 
        name="OnApplicationStart" 
        hint="Fires when the application is first created." 
        access="public" 
        output="false" 
        returntype="boolean">

       <cfset APPLICATION.aasURL = 'http://127.0.0.1:8500/aaas'>
       <cfset APPLICATION.dsn = 've0_aaas'>
       <cfset APPLICATION.aas_system = 'development (studio)'>

    <cfreturn true />
  </cffunction>
</cfcomponent>

Basically I just copied what was in the application.cfm page, and figured it would work the same. I am guessing that I have to invoke this somewhere? That is the only thing that I can think of. Any help would be great.

— EDIT —

I have added the OnRequest and OnApplicationStart methods after @EvikJames answer

<cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false" hint="Fires when the application is first created.">
    <!--- Return out. --->
    <cfset APPLICATION.aasURL = 'http://127.0.0.1:8500/aaas'>
    <cfset APPLICATION.datasource = 've0_aaas'>
    <cfset APPLICATION.aas_system = 'development (studio)'>
    <cfreturn true />
</cffunction>


<cffunction name="OnRequest" access="public" returntype="void" output="true" hint="Fires after pre page processing is complete.">
    <!--- Define arguments. --->
    <cfargument name="TargetPage" type="string" required="true">
    <!--- Include the requested page. --->
    <cfinclude template="#ARGUMENTS.TargetPage#" />

    <cfset VARIABLES.dsn = APPLICATION.dsn>
    <cfset VARIABLES.aasURL = APPLICATION.aasURL>
    <cfset VARIABLES.aas_system = APPLICATION.aas_system>
    <!--- Return out. --->
    <cfreturn />
</cffunction>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:10:09+00:00Added an answer on June 1, 2026 at 7:10 am

    In your onApplication start method, do this:

    <cfset APPLICATION.datasource = 'MyDSN'>
    

    In your onRequest method, do this:

    <cfset VARIABLES.DSN = APPLICATION.datasource>
    

    Then, this query will work:

    <cfquery datasource="#dsn#">
    // sql
    </cfquery>
    

    I should add that when you are fully upgraded, you can remove all of the code above just set the default datasource:

    <cfset THIS.datasource = 'MyDSN'>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to ASP.NET and am trying to convert a web application from
I'm trying to convert an Application.cfc to script. The original had this: <cfcomponent displayname=Application
I'm trying to convert a date string from another application in Groovy. Something like
I am trying to convert a decimal colour code from a Flash Application into
I am trying to convert a windows forms application to a windows mobile application
I'm trying to convert an ASP.NET web application to use resource files. I haven't
I am trying to convert an ASP.NET website into a web application project. The
I have an application in C# that I'm trying to convert to java. The
I have a Groovy application for Windows and am trying to convert a Hash
I'm trying to convert the PlanarImage bits into a pRgb32buffer on a WPF application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.