Connection string Issue | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Connection string Issue

Hi ,<br />I have two web servers where application is accessing a third machine for the database.<br /><br />So lets suppose web servers are Web001, Web002 and the Database servers is DataMachine(IP is 20.45.12.112).<br /><br />Connection string to connect to the DataMachine from Web001 is as below:<br />Provider=SQLOLEDB.1; Persist Security Info=False;User ID=sa; Initial Catalog=NursingCenter;Data Source=20.145.112.112<br />This works fine<br /><br />But when i use this connection string to connect the database from Web002 it gives me the error "Server doesn’t exist",<br />If i add "Network Liberary=dbmssocn" parameter to my connection string it works see below string:<br /><br />Provider=SQLOLEDB.1;Network Liberary=dbmssocn<img src=’/community/emoticons/emotion-4.gif’ alt=’;P’ />ersist Security Info=False;User ID=sa; Initial Catalog=NursingCenter;Data Source=20.145.112.112<br /><br /><br />I don’t want to user the "Network Liberary=dbmssocn" parameter in connection string.<br /><br />My question is how can i resolve this issue?Or is there any place in SQL Server 2000 where we give IP address for the clients who will access the database.<br /><br /><br />All the servers have same MDAC Level<br />Same service packs and same OS [Windows 2000 server]<br /><br /><br />
Your second server most likely has Named Pipes as the default network library and your first server has TCP/IP. So change this by Start->Run: cliconfg.exe In your second string you override the default value. dbmssocn = TCP/IP
Hi Argyle, Thanks for the reply. There is only one SQL SERVER Machine
and There are two webservers. One webserver is able to getconnected without specifying the network liberary,
The Other webserver located on diffetent machine is not able to connect with the same connection string i.e Request going from this Webserver needs the connection string with "network liberary" option. Start->Run: cliconfg.exe
This setting will be common for both the WEBSERVERS.
Did u get my problem.
Hi ya, can you check the cliconfg.exe on both webservers? Cheers
Twan
Why would you not want to add the network library parameter to the connect string? If it resolves the issue …
Hi Twan/Adriaan , I will check the cliconfg.exe on both servers,Will this cliconfg.exe exist on the machine where SQL Server is not installed.These two machines don’t have SQL Server installed.Sql server is installed on the 3 rd machine which is used by 2 web servers to access data. Adriaan – we want both the servers contain the same data and they should bereplica of weach other.
So we want the connection string should also be same.
Then check if they both work with the complete connect string?! If you don’t specify the network library in the connect string, then you are depending on the settings – so specify it to avoid the dependency.

agree with Adriaan, but yes cliconfig.exe will exist on w2k3 (and I think w2k) servers even is the SQL client tools are not instaleld Cheers
Twan
Yes as mentioned check cliconfg.exe on the web servers, not the sql server. And I also agree with the above that it’s better to specify the network library in the connectionstring on both web servers or you will be depdendant on the web servers default config. What if one web server goes down and is replaced. Will you then remember to set the same default network library on that server? You wouldn’t need to worry about that if you specified the network library in the connectionstring.
Hi Twan/Argyle/Adriaan, In the cliconfg.exe there is an Alias Tab where In one server it is defined to some path like as below [Server where we have to use the Network liberary]
//server name/pipe/sql/query But in the other server it was not defined any thing in Alias Tab.[This was working without original query string] I have removed the Alias from the server where Normal query string was not working and it works. Thanks for all of your time and support. Can some one give a hint why is this Alias is used for so that i can dig more. Thanks a lot !!!
I really appriciate this

Again … If you do not include the settings in the connection string, then the software will look for remote servers that are configured on the current computer, as visible when you open the cliconfg.exe program. These settings may not be in synch with reality (like here with the alias) and in that case you’re out of luck. So include these settings in the connection string – you’re more likely to have control over the web app, than over the computer settings, and so if a change needs to be made you know where to make it.
Yes thats true,
I will try to dig out more on this.It was a great learning today with u guys.. Thanks!
i am a little puzzled by this thread.
by specifying the ip address, the client should have automatically used tcp/ip.
only by using the server name is this up in the air, which still should have preferred tcp/ip. the only time i have seen named pipes default (except when manually set) is if the server/OS powered up with the network disconnected, in which case you must force tcp/ip or suffer with named pipes

Hi joechang,
I didn’t get you..
Can some one eloborate on this more
He mention that removing the alias worked. So most likely the connectionstring contained a name and not an ip.
]]>