Multiple ports listed in SQL Server connection string

Posted by BBlake on Stack Overflow See other posts from Stack Overflow or by BBlake
Published on 2010-05-14T14:18:54Z Indexed on 2010/05/14 16:24 UTC
Read the original article Hit count: 240

Filed under:
|
|

I have a legacy VB6 app where the servername, databasename, username, etc are defined in an INI file, but the port number for the connection string (the default 1433) is hard coded in the app. It's being moved to a new sql server back end that runs off a different port number. I'm trying to avoid having to alter and recompile the application which entails signifigant retesting, documentation, etc. I tried altering the INI file so that for the new server I have put in: SERVERNAME\INSTANCE,NEWPORTNUMBER

This effectively builds the connection with Data Source = SERVERNAME\INSTANCE,NEWPORTNUMBER,1433;

This appears to work correctly as it connects to the database when I run the app. It appears to me that the ,1433 portion is being ignored. Is this a valid assumption or will this cause me some problem I'm not seeing here?

© Stack Overflow or respective owner

Related posts about connection-string

Related posts about sql-server