Showing posts with label connecting. Show all posts
Showing posts with label connecting. Show all posts

Sunday, March 11, 2012

Error 62 When connecting with SSMS to a SQL Server 2000 named instance

Hello,

I get error 62 when trying to connect to a SQL Server 2000 named instance from SQL Server Management Studio. I can register and connect to other SQL Server 2000 instances

I've tried all the usual stuff, including enabling all the protocols from SQL Server configuration Manager.

Any thoughts. Your help is very appreciated.

Thanks

Kevin Lobo

Can you post the whole error msg? Is this a local or remote connection? What's the Service Pack of your SQL Server 2000? Make sure sql browser is on if you can. Also make sure sql browser and/or udp port 1434 is in exception list if you firewall is on.

Thanks,
Xinwei

So, actually error 26, not 62.

|||

Hello Xinwei,

Thanks. It is working now. The Browser was running but the firewall setting was on with 'Don't allow exceptions' checked. I unchecked it and its ok now.

many thanks.

Jut FYI, here is the entire error message:

An error has occured while establishing a connection to the server. When connecting to SQL Server
2005, the failure may be casued by the fact that under the default settings SQL Server does not
allow remote connections. (provider: SQL Network Interfaces, error 26 - Error locating Server/Instance
Specified) (Microsoft SQL Server)

Wednesday, March 7, 2012

error 40. Get the error locally, but not remotely!

I've got a windows 2003 server running sql server 2005. When I run a web sit
e
on a desktop machine, there is no problem connecting to the database.
But, when I run the same web site with the same connection string on the
2003 server, I get the following error:
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
Obviously remote connections and tcp are enabled. My guess is that there is
something stopping IIS from connecting to the databse. The firewall is
disabled (not that it should interfere with local activities anyway).
I've been struggling with this one for a couple days. Any help would be
greatly appreciated.The problem seemed to have fixed itself after I upgraded to Service Pack 1
for SQL 2005. I don't know if that was the problem.
"Trevor Murphy" wrote:

> I've got a windows 2003 server running sql server 2005. When I run a web s
ite
> on a desktop machine, there is no problem connecting to the database.
> But, when I run the same web site with the same connection string on the
> 2003 server, I get the following error:
> An error has occurred while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default settings SQL Server does not allow remote connections.
> (provider: Named Pipes Provider, error: 40 - Could not open a connection t
o
> SQL Server)
> Obviously remote connections and tcp are enabled. My guess is that there i
s
> something stopping IIS from connecting to the databse. The firewall is
> disabled (not that it should interfere with local activities anyway).
> I've been struggling with this one for a couple days. Any help would be
> greatly appreciated.

error 40. Get the error locally, but not remotely!

I've got a windows 2003 server running sql server 2005. When I run a web site
on a desktop machine, there is no problem connecting to the database.
But, when I run the same web site with the same connection string on the
2003 server, I get the following error:
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
Obviously remote connections and tcp are enabled. My guess is that there is
something stopping IIS from connecting to the databse. The firewall is
disabled (not that it should interfere with local activities anyway).
I've been struggling with this one for a couple days. Any help would be
greatly appreciated.
The problem seemed to have fixed itself after I upgraded to Service Pack 1
for SQL 2005. I don't know if that was the problem.
"Trevor Murphy" wrote:

> I've got a windows 2003 server running sql server 2005. When I run a web site
> on a desktop machine, there is no problem connecting to the database.
> But, when I run the same web site with the same connection string on the
> 2003 server, I get the following error:
> An error has occurred while establishing a connection to the server. When
> connecting to SQL Server 2005, this failure may be caused by the fact that
> under the default settings SQL Server does not allow remote connections.
> (provider: Named Pipes Provider, error: 40 - Could not open a connection to
> SQL Server)
> Obviously remote connections and tcp are enabled. My guess is that there is
> something stopping IIS from connecting to the databse. The firewall is
> disabled (not that it should interfere with local activities anyway).
> I've been struggling with this one for a couple days. Any help would be
> greatly appreciated.

error 40

I have VS2005, SQL 2000, SQL Express and SQL 2005 installed on my laptop wit
h
XP Pro. I have no problems connecting to SQL 2000 but get the following
error when I try to connect to SQL2005.
"When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL Server
does not allow remote connections. (provider: Named Pipes Provider, error: 4
0
- Could not open a connection to SQL Server")."
My connection String is as follows:
connectionString="Data Source=sql2005;Initial Catalog=TestDB;Integrated
Security=True"
Thanks for any help in advance.Hi
From the error message, it seems the connection stage was broken and I
would like to know if you have tried basic connectivity tests between the
two mahcines you are working on. One simple way to verifty connectivity is
to use command line tools, such as sqlcmd.exe. If it connects cross-machine
successfully, please also verify that your connection string in your
scenario is correct.
You may refer the articles below for more detailed information
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III
http://blogs.msdn.com/sql_protocols.../22/506607.aspx
How to: Configure Express to accept remote connections
http://blogs.msdn.com/sqlexpress/ar.../05/415084.aspx
How do I manage / connect to SQL Server Express?
http://www.aspfaq.com/sql2005/show.asp?id=3
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.|||Michael,
I do not have 2 machines, VS2005, SQL2005, SQL2000 are running on the same
machine for developement purposes.
Thanks.
"Michael Cheng [MSFT]" wrote:

> Hi
> From the error message, it seems the connection stage was broken and I
> would like to know if you have tried basic connectivity tests between the
> two mahcines you are working on. One simple way to verifty connectivity is
> to use command line tools, such as sqlcmd.exe. If it connects cross-machin
e
> successfully, please also verify that your connection string in your
> scenario is correct.
> You may refer the articles below for more detailed information
> Troubleshoot Connectivity Issue in SQL Server 2005 - Part III
> http://blogs.msdn.com/sql_protocols.../22/506607.aspx
> How to: Configure Express to accept remote connections
> http://blogs.msdn.com/sqlexpress/ar.../05/415084.aspx
> How do I manage / connect to SQL Server Express?
> http://www.aspfaq.com/sql2005/show.asp?id=3
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>|||Hi Chico,
Thanks for the prompt update.
What's the instance name of your SQL Express?
In your connection string, I have noticed "Data Source=sql2005", does your
machine named "SQL2005" and you installed SQL Server 2005 Express as
default instance?
If you installed SQL Server 2005 Express as named instance, you will have
to connect the instance using connection string like "Data
Source=.\sql2005" (Here, I assume sql2005 is the name for default instance)
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

error 40

I have VS2005, SQL 2000, SQL Express and SQL 2005 installed on my laptop with
XP Pro. I have no problems connecting to SQL 2000 but get the following
error when I try to connect to SQL2005.
"When connecting to SQL Server 2005, this
failure may be caused by the fact that under the default settings SQL Server
does not allow remote connections. (provider: Named Pipes Provider, error: 40
- Could not open a connection to SQL Server")."
My connection String is as follows:
connectionString="Data Source=sql2005;Initial Catalog=TestDB;Integrated
Security=True"
Thanks for any help in advance.
Hi
From the error message, it seems the connection stage was broken and I
would like to know if you have tried basic connectivity tests between the
two mahcines you are working on. One simple way to verifty connectivity is
to use command line tools, such as sqlcmd.exe. If it connects cross-machine
successfully, please also verify that your connection string in your
scenario is correct.
You may refer the articles below for more detailed information
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III
http://blogs.msdn.com/sql_protocols/...22/506607.aspx
How to: Configure Express to accept remote connections
http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx
How do I manage / connect to SQL Server Express?
http://www.aspfaq.com/sql2005/show.asp?id=3
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Michael,
I do not have 2 machines, VS2005, SQL2005, SQL2000 are running on the same
machine for developement purposes.
Thanks.
"Michael Cheng [MSFT]" wrote:

> Hi
> From the error message, it seems the connection stage was broken and I
> would like to know if you have tried basic connectivity tests between the
> two mahcines you are working on. One simple way to verifty connectivity is
> to use command line tools, such as sqlcmd.exe. If it connects cross-machine
> successfully, please also verify that your connection string in your
> scenario is correct.
> You may refer the articles below for more detailed information
> Troubleshoot Connectivity Issue in SQL Server 2005 - Part III
> http://blogs.msdn.com/sql_protocols/...22/506607.aspx
> How to: Configure Express to accept remote connections
> http://blogs.msdn.com/sqlexpress/arc...05/415084.aspx
> How do I manage / connect to SQL Server Express?
> http://www.aspfaq.com/sql2005/show.asp?id=3
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
|||Hi Chico,
Thanks for the prompt update.
What's the instance name of your SQL Express?
In your connection string, I have noticed "Data Source=sql2005", does your
machine named "SQL2005" and you installed SQL Server 2005 Express as
default instance?
If you installed SQL Server 2005 Express as named instance, you will have
to connect the instance using connection string like "Data
Source=.\sql2005" (Here, I assume sql2005 is the name for default instance)
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, February 24, 2012

Error 26: When connecting to Local Server with SQL Server 2005 Standard Edition

Hi,

I've been trying to fix this error for two days! and I really need the advice of the experts please!

Computer XP Professional Service Pack2, SQL Server 2005 and Visual Studio 2005 (both Standard Edition)

ConnectionString:

<

connectionStrings>

<add name="MyConnectionDB" connectionString="Data Source=(MyServer\SqlServer2005);Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA"providerName="System.Data.SqlClient" />

</connectionStrings>

C# code

string

myConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionDB"].ConnectionString;

SqlConnection myConnection = new SqlConnection(myConnectionString);

myConnection.Open();

Here I get the error: {"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"}

What I checked so far:

ServerName and Instance NameOK!Database, Username and passwordOK!SQL Server 2005 Surface Are Configuration - Remote connections using both TCP/IP and Pipe NamesOK!SQL Configuration Manager - Protocolos Enabled (TCP/IP, Pipes, shared)OK!SQL Server Browse running and activeOK!

Am I missing something? I never had this problem with SQL Server 2000 and Visual Studio 2003.

Thanks in advance for any help or suggestion you can give me.

Sasa

Nevermind, I reinstalled again .NET 2.0 and it works. I can't believe that I expend two days thinking it was a configuration setting

Error 26: When connecting to Local Server with SQL Server 2005 Standard Edition

Hi,

I've been trying to fix this error for two days! and I really need the advice of the experts please!

Computer XP Professional Service Pack2, SQL Server 2005 and Visual Studio 2005 (both Standard Edition)

ConnectionString:

<connectionStrings>

<add name="MyConnectionDB" connectionString="Data Source=(MyServer\SqlServer2005);Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

</connectionStrings>

C# code

string

myConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionDB"].ConnectionString;

SqlConnection myConnection = new SqlConnection(myConnectionString);

myConnection.Open();

Here I get the error: {"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"}

What I checked so far:

ServerName and Instance Name OK! Database, Username and password OK! SQL Server 2005 Surface Are Configuration - Remote connections using both TCP/IP and Pipe Names OK! SQL Configuration Manager - Protocolos Enabled (TCP/IP, Pipes, shared) OK! SQL Server Browse running and active OK! No Firewall

Am I missing something? I never had this problem with SQL Server 2000 and Visual Studio 2003.

Thanks in advance for any help or suggestion you can give me.

Sasa

Hi there,

I have managed to replicate your problem on my machine. I also managed to resolve it by removing the brackets, i.e. the "(" and ")", from the name of your data source.

So, your connection string would be:

<add name="MyConnectionDB" connectionString="Data Source=MyServer\SqlServer2005;Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

Before removing the brackets I got the same errors you were getting. After removing the brackets I could connect successfully.

Have a go at removing the brackets and see if that works for you.

Hope this helps, but sorry if it doesn't
|||

You are my hero!!!

I don't know how many times I checked that connectionstring, I was thinking it was any configuration setting.

Thanks a lot

|||Where do I go to remove the "()"?|||

you need to open de Web.config file in the <connectionStrings> section

Sasa

|||

Hi

I thought it is a joke to remove the "()" but it works, You are my hero.

barak

Error 26: When connecting to Local Server with SQL Server 2005 Standard Edition

Hi,

I've been trying to fix this error for two days! and I really need the advice of the experts please!

Computer XP Professional Service Pack2, SQL Server 2005 and Visual Studio 2005 (both Standard Edition)

ConnectionString:

<connectionStrings>

<add name="MyConnectionDB" connectionString="Data Source=(MyServer\SqlServer2005);Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

</connectionStrings>

C# code

string

myConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionDB"].ConnectionString;

SqlConnection myConnection = new SqlConnection(myConnectionString);

myConnection.Open();

Here I get the error: {"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"}

What I checked so far:

ServerName and Instance Name OK! Database, Username and password OK! SQL Server 2005 Surface Are Configuration - Remote connections using both TCP/IP and Pipe Names OK! SQL Configuration Manager - Protocolos Enabled (TCP/IP, Pipes, shared) OK! SQL Server Browse running and active OK! No Firewall

Am I missing something? I never had this problem with SQL Server 2000 and Visual Studio 2003.

Thanks in advance for any help or suggestion you can give me.

Sasa

Hi there,

I have managed to replicate your problem on my machine. I also managed to resolve it by removing the brackets, i.e. the "(" and ")", from the name of your data source.

So, your connection string would be:

<add name="MyConnectionDB" connectionString="Data Source=MyServer\SqlServer2005;Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

Before removing the brackets I got the same errors you were getting. After removing the brackets I could connect successfully.

Have a go at removing the brackets and see if that works for you.

Hope this helps, but sorry if it doesn't
|||

You are my hero!!!

I don't know how many times I checked that connectionstring, I was thinking it was any configuration setting.

Thanks a lot

|||Where do I go to remove the "()"?|||

you need to open de Web.config file in the <connectionStrings> section

Sasa

|||

Hi

I thought it is a joke to remove the "()" but it works, You are my hero.

barak

Error 26: When connecting to Local Server with SQL Server 2005 Standard Edition

Hi,

I've been trying to fix this error for two days! and I really need the advice of the experts please!

Computer XP Professional Service Pack2, SQL Server 2005 and Visual Studio 2005 (both Standard Edition)

ConnectionString:

<connectionStrings>

<add name="MyConnectionDB" connectionString="Data Source=(MyServer\SqlServer2005);Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

</connectionStrings>

C# code

string

myConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionDB"].ConnectionString;

SqlConnection myConnection = new SqlConnection(myConnectionString);

myConnection.Open();

Here I get the error: {"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"}

What I checked so far:

ServerName and Instance Name OK! Database, Username and password OK! SQL Server 2005 Surface Are Configuration - Remote connections using both TCP/IP and Pipe Names OK! SQL Configuration Manager - Protocolos Enabled (TCP/IP, Pipes, shared) OK! SQL Server Browse running and active OK! No Firewall

Am I missing something? I never had this problem with SQL Server 2000 and Visual Studio 2003.

Thanks in advance for any help or suggestion you can give me.

Sasa

Hi there,

I have managed to replicate your problem on my machine. I also managed to resolve it by removing the brackets, i.e. the "(" and ")", from the name of your data source.

So, your connection string would be:

<add name="MyConnectionDB" connectionString="Data Source=MyServer\SqlServer2005;Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA" providerName="System.Data.SqlClient" />

Before removing the brackets I got the same errors you were getting. After removing the brackets I could connect successfully.

Have a go at removing the brackets and see if that works for you.

Hope this helps, but sorry if it doesn't
|||

You are my hero!!!

I don't know how many times I checked that connectionstring, I was thinking it was any configuration setting.

Thanks a lot

|||Where do I go to remove the "()"?|||

you need to open de Web.config file in the <connectionStrings> section

Sasa

|||

Hi

I thought it is a joke to remove the "()" but it works, You are my hero.

barak

Error 26 on a local machine

I am getting the "Error Locating Server/Instance Specified" message. The part I find most confusing is that I am connecting to my database locally. I have read the recommendations on the blog posted here:

http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx


and implemented them to no avail. The confusing part is that I only have this problem on one particular application, which I am not the original author of. When I build my connection to the very same server (different database) using the Data Source configuration wizard, it works just fine. Any help would be greatly appreciated.

I have the same error and did the same thing according to your link. Thx.

|||

You said everything is fine except one application which you don't originally own. Can you post the connection string used by the application? Are you able to connect to the same server using SQL Management Studio? Are you app using .Net, SNAC(sqlncli), or MDAC? Thanks.

|||

I must ask your forgiveness. I realize now that I there were two connection strings. One for regular database usage, the other for Session state, it seems. After changing the other I am able to connect to my local one. Thank you for your reply.

Error 26 on a local machine

I am getting the "Error Locating Server/Instance Specified" message. The part I find most confusing is that I am connecting to my database locally. I have read the recommendations on the blog posted here:

http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx


and implemented them to no avail. The confusing part is that I only have this problem on one particular application, which I am not the original author of. When I build my connection to the very same server (different database) using the Data Source configuration wizard, it works just fine. Any help would be greatly appreciated.

I have the same error and did the same thing according to your link. Thx.

|||

You said everything is fine except one application which you don't originally own. Can you post the connection string used by the application? Are you able to connect to the same server using SQL Management Studio? Are you app using .Net, SNAC(sqlncli), or MDAC? Thanks.

|||

I must ask your forgiveness. I realize now that I there were two connection strings. One for regular database usage, the other for Session state, it seems. After changing the other I am able to connect to my local one. Thank you for your reply.