Saturday, February 25, 2012

Connection error 40

Hi,
I developed a programm with dot.net 2.0.
On my environment ervy thing works fine.
When I try to use it on the customers envrionment I get the following error
message:
"An error has occured while establishing a connection to the server.
When connecting to SQL Server 2005, this failuer may be cused 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)"
I want to get connect to an SQL 2000 server. Named Pipes and TCP/IP are
enabled on the server.
I use the following connection String:
"Server=server.domain.com; Initial Catalog=database.mdf;;Integrated
Security=False;Connect Timeout=30;Password=password; UID=user"
How can I solve this problem?
TIA
Marcus MngelCheck your connection string, it doesn't look right. I've never seen the
keys "UID" and "Password" used in the same connection string, and unless
you're using Express Edition, you dont need .mdf on the end of your DB name.
Check out this site for help on your connection string:
http://www.connectionstrings.com/
My guess is it should look something like this:
"Server=server.domain.com;Database=database;User ID=user;Password=password;"
"Marcus Mngel" <nc-maengema@.netcologne.de> wrote in message
news:eht7n6$t4t$1@.newsreader2.netcologne.de...
> Hi,
> I developed a programm with dot.net 2.0.
> On my environment ervy thing works fine.
> When I try to use it on the customers envrionment I get the following
> error
> message:
> "An error has occured while establishing a connection to the server.
> When connecting to SQL Server 2005, this failuer may be cused 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)"
> I want to get connect to an SQL 2000 server. Named Pipes and TCP/IP are
> enabled on the server.
> I use the following connection String:
> "Server=server.domain.com; Initial Catalog=database.mdf;;Integrated
> Security=False;Connect Timeout=30;Password=password; UID=user"
> How can I solve this problem?
> TIA
> Marcus Mngel
>
>

No comments:

Post a Comment