thanks Deanna :)  and everyone else even WILL!! 

 much appriciated!

~Dave the disruptor~
"Some people just don't appreciate how difficult it is to dispense wisdom and 
abuse at the same time." 

----------------------------------------
From: Deanna Schneider <[EMAIL PROTECTED]>
Sent: Tuesday, September 20, 2005 8:26 AM
To: CF-Talk <[email protected]>
Subject: Re: using an xml file for cfc settingsray style 

Okay, this is long, but here's some example code. Here's the dbdata 
(settings) cfc. You'd fill in "(yourdefault)" with whatever your default 
info is:

variables.dsn = "";
variables.username = "";
variables.password = "";

hint="Returns a complete DBdata object - defaults to....">

type="string">

type="string">

type="string">

setDSN(arguments.dsn);
setUsername(arguments.username);
setPassword(arguments.password);

output="false">

output="false">

output="false">

output="false">

output="false">

In an application, I'd have this code to instantiate this component, using 
the default settings:

application.dbdata = createObject("component", "yourPathToCfc.dbdata
").init();

Here's an example of instantiating some other object that uses this cfc:

application.publication = createObject("component", "yourPath.publication
").init(application.dbdata);

This is an example of an init function that requires the dbdata object

output="false" hint="Initializes the object.">

And, here's an example of a query in a cfc that uses it:

username="#variables.dbdata.getUsername()#" 
password="#variables.dbdata.getPassword()#">
SELECT *
FROM blah

On 9/19/05, Will Tomlinson  wrote:
> 
> (So, if we had a cfc
> >that needed username, dsn, etc, we'd require that it be passed into an 
> init
> >function - the cfc doesn't know that the application scope exists.)
> >
> >Make sense?
> 
> Yes this makes good sense, but I think what would help most is if you 
> could show us some *REALLY* basic example code. We have no problem reading 
> the xml or ini into applications scope, but our question arises on the best 
> method for giving the data to the cfc. Trying to understand what Ray is 
> doing with galleon is just too complex for a couple of rookies. :) We need 
> to crawl first.
> 
> Thanks much,
> Will
> 
> 
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218768
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to