Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

When the instance name is specified, it is invalid to specify the port number

$
0
0

Hi,

 

I am using ColdFusion11 version 11,0,03,292480 with java 8 installed and am using the coldfusion API setMSSQL function to create an mssql datasource.  The datasource is a named instance and when it is created I get the below error when it tries to verify:

 

java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Conflicting connection information. When the instance name is specified, it is invalid to specify the port number.

The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Conflicting connection information. When the instance name is specified, it is invalid to specify the port number.

 

I have tried removing the port argument (port end up being set to 1433) and even setting the port to an empty string (port ends up set to 0).  Can anyone help set a blank port number when creating a named instance datasource using the API please?

 

API call code:

 

<!--- initialize the admin API ---><cfset Administrator = CreateObject("component","cfide.adminapi.administrator")/><!--- login is always required ---><cfset Administrator.login(adminpassword=url.apiPass,adminuserid="admin")/><!--- instantiate the data source object ---><cfset Datasource = CreateObject("component","CFIDE.adminapi.datasource")/><cfif url.validateonly eq "false">    <!--- set the datasource configuration settings --->    <cfset args = {}/>    <cfset args.name = url.name/>    <cfset args.database = url.database/>    <cfset args.host = url.host/>    <cfif url.dbport eq "null">        <cfset args.port = ""/>    <cfelse>        <cfset args.port = url.port/>    </cfif>    <cfset args.username = url.username/>    <cfset args.password = url.password/>    <cfset args.sendStringParametersAsUnicode = url.unicode/>    <cfset args.encryptpassword = true/>    <cfset args.selectmethod = "direct"/>     ...    <!--- Extra arguments in here etc. --->     ...    <!--- create MSSQL datasource --->    <!--- allowed roles: data & services > data sources --->    <cfset Datasource.setMSSQL(argumentCollection=args)/><cfelse>    <!--- verify datasource --->    <cfset verified = Datasource.verifyDSN(dsn=url.name,returnMsgOnError=true)/>    <!--- if unverified show the error message --->    <cfif IsBoolean(verified) And verified>        <cfheader statusCode="200" statusText="OK" />          <h2>true</h2>    <cfelse>        <cfheader statusCode="418" statusText="Message" />           <h2>false</h2>     </cfif></cfif>    </cfif></cfif>

Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>