Cannot connect to MSSQL2005 (Local) Server?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I can't connect to MSSQL2005 Standard when providing (Local) for the "data
source=" property in the connection string.
When setting the computer name instead of (Local) it does connect!

Why I can't connect with (Local)?

Thanks in advanced,
Asaf
 
¤ Hello,
¤
¤ I can't connect to MSSQL2005 Standard when providing (Local) for the "data
¤ source=" property in the connection string.
¤ When setting the computer name instead of (Local) it does connect!
¤
¤ Why I can't connect with (Local)?

You might want to provide a bit more information, such as the connection string you are using and
any error messages that are being generated.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hello Paul,

The C# Connection string is:

workstation id=TestCOMP;packet size=4096;user id=sa;data
source="(Local)";persist security info=True;initial
catalog=TestDB;password=12345


Error message:

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

Regards,
Asaf
 
Do you actually use quote mark around "(local)", as you showed? In the
connectionString, it should be

....data source=(local);...

Not

....data source="(local)";...

Asaf said:
Hello Paul,

The C# Connection string is:

workstation id=TestCOMP;packet size=4096;user id=sa;data
source="(Local)";persist security info=True;initial
catalog=TestDB;password=12345


Error message:

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

Regards,
Asaf

Paul Clement said:
¤ Hello,
¤
¤ I can't connect to MSSQL2005 Standard when providing (Local) for the
"data
¤ source=" property in the connection string.
¤ When setting the computer name instead of (Local) it does connect!
¤
¤ Why I can't connect with (Local)?

You might want to provide a bit more information, such as the connection
string you are using and
any error messages that are being generated.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hello Norman,

I am using only (Local).

I can Login to SQL Server with the "SQL Server management studio" using
(Local) at the "Server Name".

But when I place a "sqlConnection" control on a Windows Form I *can't*
connect to (Local).

Regards,
Asaf


Norman Yuan said:
Do you actually use quote mark around "(local)", as you showed? In the
connectionString, it should be

....data source=(local);...

Not

....data source="(local)";...

Asaf said:
Hello Paul,

The C# Connection string is:

workstation id=TestCOMP;packet size=4096;user id=sa;data
source="(Local)";persist security info=True;initial
catalog=TestDB;password=12345


Error message:

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

Regards,
Asaf

Paul Clement said:
¤ Hello,
¤
¤ I can't connect to MSSQL2005 Standard when providing (Local) for the
"data
¤ source=" property in the connection string.
¤ When setting the computer name instead of (Local) it does connect!
¤
¤ Why I can't connect with (Local)?

You might want to provide a bit more information, such as the connection
string you are using and
any error messages that are being generated.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
¤ Hello Paul,
¤
¤ The C# Connection string is:
¤
¤ workstation id=TestCOMP;packet size=4096;user id=sa;data
¤ source="(Local)";persist security info=True;initial
¤ catalog=TestDB;password=12345
¤
¤
¤ Error message:
¤
¤ [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
¤ denied.
¤

Is SQL Server configured for SQL Server Authentication? It's possible that it may only be configured
for Windows Authentication.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hello Paul,

The server is not configured to use only Windows Authentication as I can
login from the "SQL Server Managment studio" using (Local) at the name server.
 
Hi,

I have found the solution.

At SQL Server 2005 configuration manager -> SQL Server 2005 Network
Configuration -> Protocols For MSSQLSERVER.

TCP/IP must be enabled with TCP port 1433

Now I can login from my connection string to (Local) name server.


Regards,
Asaf
 
I had to enable TCP/IP - it's disabled by default. Did that and
verified the port was 1433 and everything worked great for me too.
Thanks!
 
Back
Top