How come urlPath.PORT = 1433;
instead of urlPath.PORT = "1433"?
Shouldn't 1433 be a string, which requires quotes?
And I did not get any error msg.
Thanks.
> <CFOBJECT ACTION="" TYPE="JAVA"
> CLASS="coldfusion.server.ServiceFactory" NAME="factory">
>
> <cfscript>
> ds_service = factory.DataSourceService;
>
> ds = StructNew();
> ds.CLASS = "macromedia.jdbc.MacromediaDriver";
> ds.DRIVER = "MSSQLServer";
> ds.NAME = FORM.dsName;
> ds.DATABASE = FORM.dbName;
> ds.HOST = FORM.serverName;
> ds.username = FORM.un;
> ds.password = ds_service.encryptPasword(FORM.pwd);
>
> urlPath = StructNew();
> urlPath.DATABASE = FORM.dbName;
> urlPath.HOST = FORM.serverName;
> urlPath.PORT = 1433;
> urlPath.SELECTMETHOD = "direct";
> urlPath.SENDSTRINGPARAMETERSASUNICODE = "false";
> // You might need to fix the following line, don't know if URLMAP
> is the correct name
> ds.urlmap = urlPath;
>
> ds_service["datasources"][FORM.dsName] = ds;
>
> </cfscript>
>
> <cfdump var = "#factory.DataSourceService.datasources#">
>
> > Execution results:
> > 1) cfdump displays all datasources of the CFMX installation YET the
> new ds is not added;
>
> There are various errors in the code where you use names of
> objects as strings instead of objects. Also, you assign values
> twice, which means the first value is overwritten.
>
>
> > 2) error code/msg/detail is EMPTY
>
> The code you gave shouldn't return an error because it is
> syntactically correct. It just doesn't do what you want it to do
> either.
>
> Jochem
>
> --
> When you don't want to be surprised by the revolution
> organize one yourself
> - Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

