views:

45

answers:

1

Hi,

I have some problem with my cfml website.

I have used the below code in application.cfc file to connect with the dsn.

But when ever i put this in my server, i'm getting error. i cant browse even a single test.cfm page.

Is there any mistake in that code , any syntax error or something like that, will it be some problem with the dsn

<cfset this.name = "0307de6.netsolhost.com">
<cfset this.sessionmanagement = true>
<cfset this.loginstorage="session">
<cfset this.sessiontimeout = CreateTimeSpan(0,0,30,0)>
<cfset this.applicationtimeout = CreateTimeSpan(2,0,0,0)>

<cffunction name="onApplicationStart">

    <cfscript>
        application.DSN             = "hirerodsn";
        application.dbUserName      = "myusr";
        application.dbPassword      = "myd69!";
    </cfscript>

</cffunction>

<cffunction name="onRequestStart">

    <cfscript>
        request.DSN = "hirerodsn";
        request.dbUserName = "myusr";
        request.dbPassword = "myd69!";
    </cfscript>

</cffunction>

please anyone help me

+1  A: 

Please note that you should also post at least error messages in your questions.

Any way, your error here is that you have to enclose whole .cfc file contents inside cfcomponent tag:

<cfcomponent output="false">
...
</cfcomponent>

Also please note that you can set the username and password in datasource configuration, so you don't really need to handle them in your code (queries).

Sergii
CF9 doesn't throw an error if the component declaration in application.cfc is missing. Copied the code over to my server and it works for me. Agree, that an error message would be helpful. It also would be good to know, on which environment the app is running on.
Andreas Schuldhaus