On 9/5/00, Miriam Hirschman penned:
>I thought that the application.cfm page is called before each page in that
>directory.

Well, that's why we needed to see some code. :-D No telling what some 
folks may do.

>  So why doesn't the variable get updated before the page loads.
>Also, I've used this code before in other applications without a problem.
>I'm not sure I understand why this method is giving me an error now.  In a
>CF article I read, it said that it is better not to hard code the DSN name,
>because it makes your code hard to maintain.  Please explain.

Just a thought, but:

If you are using 2 datasources, and you are loading 2 separate 
application.cfm pages and each one is using the same application name 
if the cfapplication tag and you are naming the datasources 
differently, ie; application.settings.dsn=dsn1 in one application.cfm 
and application.settings.dsn=dns2 in the other, than I could see 
there being a potential for a problem.

I'm not sure, but what I think may be happening is, you are using the 
scenario above. Then, when you go to the second page, and you are 
checking to see if application.settings.dsn is defined, and it's not 
so the other datasource name loads and the query returns an error, 
perhaps then killing the application variable (anyone?). Thus, the 
new datasource name loads on the subsequent refresh of the page.

I would change the code to:

application.settings.dsn1=dsn1 in one app.cfm
application.settings.dsn2=dns2 in the other

Then change the datasource name accordingly in the queries that call them.
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to