Skip to main content
Inspiring
August 19, 2010
Question

datasource username/password

  • August 19, 2010
  • 2 replies
  • 310 views

Hi,

I've been trying to put my site online, and I could do what I need to, but I have a feeling that there is an easier and quicker way to do what I need to.

The pages of my site don't work unless I go back and add a username and password to all my queries/bindings one query/binding at a time... but I'm thinking that there might be a way to do this more efficiently using Application.cfc.  Is there a quicker way?

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    August 19, 2010

    On CF9 you can set this.datasource in your Application.cfc and it will

    be the default datasource for the cfquery tag (in CF9.01 you can also

    set the username and password).

    --

    Mack

    ilssac
    Inspiring
    August 19, 2010

    You could either set variables that are used in all your queries and bindings and then set those variables someplace global, such as an appropriate method in the Applicaiton.cfc file.

    OR

    You can define all the database connectivity information in the data source name section of the ColdFusion Administrator control panel.  Then you would just need to use the datascouce name in your quries and bindings.