the code pretty much done, but the DSN that is created will not work.
I am going to the service factory, grabbing a template DSN and copying
it. Setting the struct values as necessary, then setting the new dsn in
the service factory. It creates the new dsn...you can see it now in the
cfadmin, but it will not authenticate, even though the auth info is
correct. I am not sure where to go now.
Here is my code (from a cfc):
<cflock name="serviceFactory" type="exclusive" timeout="10">
<cfscript>
factory = CreateObject("java", "coldfusion.server.ServiceFactory");
ds_service = factory.datasourceservice;
dsources = ds_service.datasources;
</cfscript>
<cfscript>
// get template_dsn as a temp struct to config and copy
dsncopy = Duplicate(dsources['template_dsn']);
// set the dsn config to temp struct
dsncopy.name = arguments.dbname;
dsncopy.url = '' & arguments.dbname
& '?';
dsncopy.urlmap.CONNECTIONPROPS.DATABASE = arguments.dbname;
dsncopy.urlmap.database = arguments.dbname;
// if user wants to save auth info in dsn, set it here
if (arguments.storepass) {
dsncopy.username = arguments.dbuser;
dsncopy.password = ds_service.encryptPassword(arguments.dbpasswd);
}
// set the new datasource struct in the service factory
dsources[arguments.dsname] = Duplicate(dsncopy);
</cfscript>
</cflock>
Any ideas?
Thanks
-Josh
---
exciteworks hosting solutions
CF hosting starting as low as $10.95 per month
http://exciteworks.com
30 days free for house of fusion members!
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

