Discuss Datasource variable not working in CFC in the ColdFusion Development forum on Dev Shed. Datasource variable not working in CFC ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
Posts: 33
Time spent in forums: 12 h 58 m 36 sec
Reputation Power: 7
Datasource variable not working in CFC
I'm creating a new feature using a cfc, which the current app doesn't utilize right now. I need to query our database, but the variable that I have set doesn't seem to be working, and just returning an empty string. Here is what I have to initialize the cfc.
Posts: 33
Time spent in forums: 12 h 58 m 36 sec
Reputation Power: 7
I'll give that a shot, but I thought that the init function was to initialize "setup" all variables used throughout the CFC? I've used CFC's in the past, but never from scratch, so I'm in unknown waters.
check out this link for a reference of what I'm trying to do, but doesn't seem to work. Am I missing something?
I don't know if it makes a difference, but we are still using CF 7
The component get instantiated by init, and sets the variables.dsn to null, then calls the init,and sets variables.dsn to the value that is passed into the init method.
Or am I just not thinking about it correctly, because it seemed as if the variables.dsn value was getting set back to null when I called the other method that was running the query in question.