Leen3o


Hi all... Very much a newbie here to setting up SQL server, and am pulling my hair out over a problem...

I have a VPS running Win2003 64bit and have setup my ASP forum on it (I also have SQLExpress 2005 installed on the VPS) - I have a SQL DataBase running on an external server which my old host setup for me and the old forum has been using... Now all I want to do is for my ASP forum on my server to connect to this external SQL DB... How easy! Well not for me ..

This is the error
Microsoft OLE DB Provider for SQL Server
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

I know its my VPS causing the problem, as I asked a friend to see if he could connect to it via his server and the forum worked straight off no changes...

After some investigating I have found a few threads about advice but still cannot get it to connect to the external SQL DB (BTW I can connect to a SQL DB on my server its just externally)... This is what I have done / Checked so far..

  1. I have changed the connection string to include the port number 1433
    (Provider=sqloledb;Data Source=THEIPADDRESS,1433;Initial Catalog=DB;User ID=xxxxx;Password=xxxx;)

  2. I can ping the IP address of the external SQL Server with no problems

  3. On my server I have enabled TCP/IP in SQLExpress & added sqlservr.exe as an exception in the Firewall

  4. I have even tried turning the Firewall off completely while I tried to connect - But still nothing.

If anyone can help me I would be very appreciated.... I am starting to tear my hair out as I can't think what else I need to do

Thanks




Re: Problem connecting to external SQL Server

Barry Andrew


Hi please try;

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
note: DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.

Or...

Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

Again;
note: DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.
And to state the obvious, enter your servers IP






Re: Problem connecting to external SQL Server

Leen3o

Barry ... You are an absolute LEGEND!!!! Fantastic.... This one worked straight away...

Provider=sqloledb;Data Source=190.190.200.100,143;Network Library=DBMSSOC;Initial Catalog=myDataBas;User ID=myUsernam;Password=myPassword;

Can't thank you enough.... Brilliant!!





Re: Problem connecting to external SQL Server

Barry Andrew

Your very welcome Leen3o!

Can I ask you a favour and you mark my answer as correct please

Thanks again = )

Barry






Re: Problem connecting to external SQL Server

Leen3o

Hi Barry... It won't let me mark it as an answer for some reason