Friday, February 10, 2012

Connecting to SQL Server 2005 Express from a Remote Machine (using Named Instance)

Hi

I have Installed Microsoft SQL Server 2005 Express (Named Instance:=01HW050876\SQLEXPRESS) in my machine (OS : Windows XP). I am using ADO in Visual Basic 6 to connect to the database. I use SQL Server Authentication to connect to ther server. It works fine if I connect from my machine. However, if i try to connect from a different machine I get the following error:

Unhandled Error [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

Here is my connection string:

Public Const CONNECT_STRING_SQL As String = "PROVIDER=SQLOLEDB.1;SERVER=01HW050876\SQLEXPRESS;UID=user;PWD=sqlpwd;DATABASE=SalesWindow"

I have also used the Ip address

Public Const CONNECT_STRING_SQL As String = "PROVIDER=SQLOLEDB.1;SERVER=xxx.xxx.xxx.xxx\SQLEXPRESS;UID=user;PWD=sqlpwd;DATABASE=SalesWindow"

The other computer is also in the same network and I was able to ping my machine from there. I have also set the login mode of the SQLServer to Mixed mode in the registry and have added the user from the other machine to the database and have given access rights.

Could you help me to track down the problem

Many thanks in Advance
Regards
Shasur

1. Enable TCP or/and Named Pipe for the sqlexpress instance.

2. Made exception in the firewall of your sqlexpress machine, the xp machine, for the sqlbrowser service and sqlexpress instance.

You can also take a look at the following blog,

http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

No comments:

Post a Comment